mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Sema: Nuke NominalTypeDecl::markInvalidGenericSignature()
This would just set the NominalTypeDecl's declared type to ErrorType, which caused problems elsewhere. Instead, generalize the logic used for AbstractFunctionDecl. This correctly wires up the GenericTypeParamDecl's archetypes even if the signature didn't validate, fixing crashes if the generic parameters of the type are referenced.
This commit is contained in:
@@ -1922,13 +1922,6 @@ void NominalTypeDecl::setGenericSignature(GenericSignature *sig) {
|
||||
GenericSig = sig;
|
||||
}
|
||||
|
||||
void NominalTypeDecl::markInvalidGenericSignature() {
|
||||
ASTContext &ctx = getASTContext();
|
||||
overwriteType(ErrorType::get(ctx));
|
||||
if (!getDeclaredType())
|
||||
setDeclaredType(ErrorType::get(ctx));
|
||||
}
|
||||
|
||||
void NominalTypeDecl::computeType() {
|
||||
assert(!hasType() && "Nominal type declaration already has a type");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user