File tree Expand file tree Collapse file tree 2 files changed +25
-10
lines changed Expand file tree Collapse file tree 2 files changed +25
-10
lines changed Original file line number Diff line number Diff line change @@ -6425,17 +6425,22 @@ class DeclChecker : public DeclVisitor<DeclChecker> {
6425
6425
}
6426
6426
}
6427
6427
6428
- // Type check the constructor parameters.
6429
- if (CD->isInvalid () || semaFuncParamPatterns (CD)) {
6430
- CD->overwriteType (ErrorType::get (TC.Context ));
6431
- CD->setInterfaceType (ErrorType::get (TC.Context ));
6432
- CD->setInvalid ();
6433
- } else {
6434
- configureConstructorType (CD, SelfTy,
6435
- CD->getParameterList (1 )->getType (TC.Context ));
6428
+ {
6429
+ CD->setIsBeingTypeChecked (true );
6430
+ SWIFT_DEFER { CD->setIsBeingTypeChecked (false ); };
6431
+
6432
+ // Type check the constructor parameters.
6433
+ if (CD->isInvalid () || semaFuncParamPatterns (CD)) {
6434
+ CD->overwriteType (ErrorType::get (TC.Context ));
6435
+ CD->setInterfaceType (ErrorType::get (TC.Context ));
6436
+ CD->setInvalid ();
6437
+ } else {
6438
+ configureConstructorType (CD, SelfTy,
6439
+ CD->getParameterList (1 )->getType (TC.Context ));
6436
6440
6437
- if (!CD->isGenericContext ())
6438
- TC.configureInterfaceType (CD);
6441
+ if (!CD->isGenericContext ())
6442
+ TC.configureInterfaceType (CD);
6443
+ }
6439
6444
}
6440
6445
6441
6446
validateAttributes (TC, CD);
Original file line number Diff line number Diff line change @@ -66,3 +66,13 @@ struct SomeStruct<A> {
66
66
typealias A = A // expected-error {{type alias 'A' circularly references itself}}
67
67
}
68
68
69
+ // <rdar://problem/27680407> Infinite recursion when using fully-qualified associatedtype name that has not been defined with typealias
70
+ protocol rdar27680407Proto {
71
+ associatedtype T // expected-note {{protocol requires nested type 'T'; do you want to add it?}}
72
+
73
+ init ( value: T )
74
+ }
75
+
76
+ struct rdar27680407Struct : rdar27680407Proto { // expected-error {{type 'rdar27680407Struct' does not conform to protocol 'rdar27680407Proto'}}
77
+ init ( value: rdar27680407Struct . T ) { }
78
+ }
You can’t perform that action at this time.
0 commit comments