Skip to content

Commit c258f99

Browse files
committedDec 14, 2015
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.
1 parent dfbb580 commit c258f99

File tree

713 files changed

+728
-735
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

713 files changed

+728
-735
lines changed
 

‎include/swift/AST/Decl.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2871,9 +2871,6 @@ class NominalTypeDecl : public TypeDecl, public DeclContext,
28712871
return GenericSig;
28722872
}
28732873

2874-
/// Mark generic type signature as invalid.
2875-
void markInvalidGenericSignature();
2876-
28772874
/// getDeclaredType - Retrieve the type declared by this entity.
28782875
Type getDeclaredType() const { return DeclaredTy; }
28792876

‎lib/AST/Decl.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1922,13 +1922,6 @@ void NominalTypeDecl::setGenericSignature(GenericSignature *sig) {
19221922
GenericSig = sig;
19231923
}
19241924

1925-
void NominalTypeDecl::markInvalidGenericSignature() {
1926-
ASTContext &ctx = getASTContext();
1927-
overwriteType(ErrorType::get(ctx));
1928-
if (!getDeclaredType())
1929-
setDeclaredType(ErrorType::get(ctx));
1930-
}
1931-
19321925
void NominalTypeDecl::computeType() {
19331926
assert(!hasType() && "Nominal type declaration already has a type");
19341927

0 commit comments

Comments
 (0)