File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed
validation-test/Sema/type_checker_crashers_fixed Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -336,8 +336,9 @@ bool RequirementFailure::diagnoseAsError() {
336
336
return true ;
337
337
}
338
338
339
- if (genericCtx != reqDC && (genericCtx->isChildContextOf (reqDC) ||
340
- isStaticOrInstanceMember (AffectedDecl))) {
339
+ if (reqDC->isTypeContext () && genericCtx != reqDC &&
340
+ (genericCtx->isChildContextOf (reqDC) ||
341
+ isStaticOrInstanceMember (AffectedDecl))) {
341
342
auto *NTD = reqDC->getSelfNominalTypeDecl ();
342
343
emitDiagnostic (anchor->getLoc (), getDiagnosticInRereference (),
343
344
AffectedDecl->getDescriptiveKind (),
Original file line number Diff line number Diff line change
1
+ // RUN: not %target-swift-frontend %s -typecheck
2
+
3
+ protocol A { }
4
+
5
+ class C < T> where T: A { }
6
+
7
+ extension C {
8
+ func foo( ) {
9
+ extension C where T: Undefined {
10
+ class Inner : Encodable {
11
+ var foo : Int
12
+ }
13
+ }
14
+ }
15
+ }
You can’t perform that action at this time.
0 commit comments