File tree Expand file tree Collapse file tree 3 files changed +9
-0
lines changed Expand file tree Collapse file tree 3 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -242,3 +242,7 @@ extension PublicGenericStruct where T == InternalStructForConstraint {}
242
242
243
243
extension PublicGenericStruct : EmptyPublicProto where T == InternalStructForConstraint { }
244
244
245
+ // MARK: - Type aliases
246
+
247
+ public typealias PublicStructAlias = PublicStruct
248
+ typealias InternalTypeAlias = DoesNotExist // expected-error {{cannot find type 'DoesNotExist' in scope}}
Original file line number Diff line number Diff line change @@ -89,3 +89,7 @@ func takesEmptyProto<T: EmptyPublicProto>(_ t: T) {}
89
89
func testConditionalConformance< T> ( _ s: PublicGenericStruct < T > ) {
90
90
takesEmptyProto ( s) // expected-error {{global function 'takesEmptyProto' requires}}
91
91
}
92
+
93
+ func testTypealiases( ) {
94
+ let _: PublicStruct = PublicStructAlias ( x: 1 )
95
+ }
Original file line number Diff line number Diff line change 102
102
// CHECK: public func req() throws -> Swift.Int
103
103
// CHECK: }
104
104
// CHECK: #endif
105
+ // CHECK: public typealias PublicStructAlias = lazy_typecheck.PublicStruct
105
106
// CHECK: @available(*, unavailable)
106
107
// CHECK-NEXT: extension lazy_typecheck.PublicGenericStruct : lazy_typecheck.EmptyPublicProto where T : _ConstraintThatIsNotPartOfTheAPIOfThisLibrary {}
107
108
// CHECK: extension lazy_typecheck.PublicStructIndirectlyConformingToPublicProto : lazy_typecheck.PublicProto {}
You can’t perform that action at this time.
0 commit comments