File tree Expand file tree Collapse file tree 2 files changed +20
-2
lines changed
validation-test/compiler_crashers_2_fixed Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -7915,6 +7915,19 @@ void TypeChecker::addImplicitConstructors(NominalTypeDecl *decl) {
7915
7915
return paramTy->getCanonicalType ();
7916
7916
};
7917
7917
7918
+ // Bail out if we're validating one of our constructors already; we'll
7919
+ // revisit the issue later.
7920
+ bool alreadyValidatingCtor = false ;
7921
+ for (auto member : decl->getMembers ()) {
7922
+ if (auto ctor = dyn_cast<ConstructorDecl>(member)) {
7923
+ validateDecl (ctor);
7924
+ if (!ctor->hasValidSignature ())
7925
+ alreadyValidatingCtor = true ;
7926
+ }
7927
+ }
7928
+ if (alreadyValidatingCtor)
7929
+ return ;
7930
+
7918
7931
// Check whether there is a user-declared constructor or an instance
7919
7932
// variable.
7920
7933
bool FoundMemberwiseInitializedProperty = false ;
@@ -7926,8 +7939,6 @@ void TypeChecker::addImplicitConstructors(NominalTypeDecl *decl) {
7926
7939
llvm::SmallPtrSet<ConstructorDecl *, 4 > overriddenInits;
7927
7940
for (auto member : decl->getMembers ()) {
7928
7941
if (auto ctor = dyn_cast<ConstructorDecl>(member)) {
7929
- validateDecl (ctor);
7930
-
7931
7942
if (ctor->isDesignatedInit ())
7932
7943
FoundDesignatedInit = true ;
7933
7944
Original file line number Diff line number Diff line change
1
+ // RUN: not %target-swift-frontend %s -typecheck -o /dev/null
2
+
3
+ class FakeDictionary < KeyType, ValueType> : ExpressibleByDictionaryLiteral {
4
+ convenience required init ( dictionaryLiteral elements: ( FakeDictionary . Key , FakeDictionary . Value ) ... ) {
5
+ self . init ( )
6
+ }
7
+ }
You can’t perform that action at this time.
0 commit comments