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 @@ -337,8 +337,9 @@ bool RequirementFailure::diagnoseAsError() {
337
337
return true ;
338
338
}
339
339
340
- if (genericCtx != reqDC && (genericCtx->isChildContextOf (reqDC) ||
341
- isStaticOrInstanceMember (AffectedDecl))) {
340
+ if (reqDC->isTypeContext () && genericCtx != reqDC &&
341
+ (genericCtx->isChildContextOf (reqDC) ||
342
+ isStaticOrInstanceMember (AffectedDecl))) {
342
343
auto *NTD = reqDC->getSelfNominalTypeDecl ();
343
344
emitDiagnostic (anchor->getLoc (), getDiagnosticInRereference (),
344
345
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