1- // RUN: %target-swift-frontend -emit-silgen %s -parse-as-library -module-name Test -enable-library-evolution -experimental-lazy-typecheck -verify
1+ // RUN: %target-swift-frontend -emit-silgen %s -parse-as-library -enable-library-evolution -module-name Test -experimental-lazy-typecheck -verify
2+ // RUN: %target-swift-frontend -emit-silgen %s -parse-as-library -enable-library-evolution -module-name Test -experimental-lazy-typecheck -experimental-skip-non-inlinable-function-bodies -verify
3+ // RUN: %target-swift-frontend -emit-silgen %s -parse-as-library -enable-library-evolution -module-name Test -experimental-lazy-typecheck -experimental-skip-non-inlinable-function-bodies -experimental-skip-non-exportable-decls -verify
4+
25
36public protocol Proto {
47 func req( )
@@ -21,3 +24,32 @@ public protocol ProtoWithAssociatedType {
2124public struct ConformsToProtoProtoWithAssociatedType : ProtoWithAssociatedType {
2225 // expected-error@-1 {{type 'ConformsToProtoProtoWithAssociatedType' does not conform to protocol 'ProtoWithAssociatedType'}}
2326}
27+
28+ public struct GenericStruct < T> {
29+ public var t : T
30+ }
31+
32+ public struct GenericStructWithInvalidParameterConstraint < T: NonExistent > {
33+ // expected-error@-1 {{cannot find type 'NonExistent' in scope}}
34+ }
35+
36+ extension GenericStruct where T == NonExistent {
37+ // expected-error@-1 {{cannot find type 'NonExistent' in scope}}
38+ public func methodInExtensionWithInvalidWhereClause( ) { }
39+ }
40+
41+ public class ValidClass {
42+ public func methodReturningNonExistentType( ) -> NonExistent { }
43+ // expected-error@-1 {{cannot find type 'NonExistent' in scope}}
44+ }
45+
46+ public class DerivedFromValidClass : ValidClass {
47+ override public func methodReturningNonExistentType( ) -> NonExistent { }
48+ // expected-error@-1 {{cannot find type 'NonExistent' in scope}}
49+ }
50+
51+ public class DerivedFromNonExistent : NonExistent {
52+ // expected-error@-1 {{cannot find type 'NonExistent' in scope}}
53+
54+ public func method( ) { }
55+ }
0 commit comments