mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Ensure that we don't end up with interface types that involve type variables.
Swift SVN r10757
This commit is contained in:
@@ -430,10 +430,21 @@ Type ValueDecl::getInterfaceType() const {
|
||||
if (!hasType())
|
||||
return Type();
|
||||
|
||||
InterfaceTy = getType();
|
||||
// If the type involves a type variable, don't cache it.
|
||||
auto type = getType();
|
||||
if (type->hasTypeVariable())
|
||||
return type;
|
||||
|
||||
InterfaceTy = type;
|
||||
return InterfaceTy;
|
||||
}
|
||||
|
||||
void ValueDecl::setInterfaceType(Type type) {
|
||||
assert((type.isNull() || !type->hasTypeVariable()) &&
|
||||
"Type variable in interface type");
|
||||
InterfaceTy = type;
|
||||
}
|
||||
|
||||
Type TypeDecl::getDeclaredType() const {
|
||||
if (auto TAD = dyn_cast<TypeAliasDecl>(this))
|
||||
return TAD->getAliasType();
|
||||
|
||||
Reference in New Issue
Block a user