File tree Expand file tree Collapse file tree 2 files changed +20
-6
lines changed Expand file tree Collapse file tree 2 files changed +20
-6
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,12 @@ void SILGenModule::useConformance(ProtocolConformanceRef conformanceRef) {
33
33
// If the conformance is invalid, crash deterministically even in noassert
34
34
// builds.
35
35
if (conformanceRef.isInvalid ()) {
36
+ // When lazy type checking is enabled, a conformance may only be diagnosed
37
+ // as invalid during SILGen. Ignore it instead of asserting.
38
+ auto &ctx = getASTContext ();
39
+ if (ctx.TypeCheckerOpts .EnableLazyTypecheck && ctx.hadError ())
40
+ return ;
41
+
36
42
llvm::report_fatal_error (" Invalid conformance in type-checked AST" );
37
43
}
38
44
Original file line number Diff line number Diff line change @@ -7,12 +7,12 @@ public protocol Proto {
7
7
func req( )
8
8
}
9
9
10
- public struct ConformsToProtoMissingRequirement : Proto {
11
- // expected-error@-1 {{type 'ConformsToProtoMissingRequirement ' does not conform to protocol 'Proto'}}
10
+ public struct ConformsToProto_MissingRequirement : Proto {
11
+ // expected-error@-1 {{type 'ConformsToProto_MissingRequirement ' does not conform to protocol 'Proto'}}
12
12
}
13
13
14
- public struct ConformsToProtoNearMiss : Proto {
15
- // expected-error@-1 {{type 'ConformsToProtoNearMiss ' does not conform to protocol 'Proto'}}
14
+ public struct ConformsToProto_NearMiss : Proto {
15
+ // expected-error@-1 {{type 'ConformsToProto_NearMiss ' does not conform to protocol 'Proto'}}
16
16
17
17
public func req( x: Int ) { }
18
18
}
@@ -21,8 +21,16 @@ public protocol ProtoWithAssociatedType {
21
21
associatedtype A
22
22
}
23
23
24
- public struct ConformsToProtoProtoWithAssociatedType : ProtoWithAssociatedType {
25
- // expected-error@-1 {{type 'ConformsToProtoProtoWithAssociatedType' does not conform to protocol 'ProtoWithAssociatedType'}}
24
+ public struct ConformsToProtoWithAssociatedType_MissingTypeRequirement : ProtoWithAssociatedType {
25
+ // expected-error@-1 {{type 'ConformsToProtoWithAssociatedType_MissingTypeRequirement' does not conform to protocol 'ProtoWithAssociatedType'}}
26
+ }
27
+
28
+ public protocol ProtoWithConstrainedAssociatedType {
29
+ associatedtype A : Proto
30
+ }
31
+
32
+ public struct ConformsToProtoWithConstrainedAssociatedType_MissingTypeRequirement : ProtoWithConstrainedAssociatedType {
33
+ // expected-error@-1 {{type 'ConformsToProtoWithConstrainedAssociatedType_MissingTypeRequirement' does not conform to protocol 'ProtoWithConstrainedAssociatedType'}}
26
34
}
27
35
28
36
public struct GenericStruct < T> {
You can’t perform that action at this time.
0 commit comments