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 {}
242242
243243extension PublicGenericStruct : EmptyPublicProto where T == InternalStructForConstraint { }
244244
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) {}
8989func testConditionalConformance< T> ( _ s: PublicGenericStruct < T > ) {
9090 takesEmptyProto ( s) // expected-error {{global function 'takesEmptyProto' requires}}
9191}
92+
93+ func testTypealiases( ) {
94+ let _: PublicStruct = PublicStructAlias ( x: 1 )
95+ }
Original file line number Diff line number Diff line change 102102// CHECK: public func req() throws -> Swift.Int
103103// CHECK: }
104104// CHECK: #endif
105+ // CHECK: public typealias PublicStructAlias = lazy_typecheck.PublicStruct
105106// CHECK: @available(*, unavailable)
106107// CHECK-NEXT: extension lazy_typecheck.PublicGenericStruct : lazy_typecheck.EmptyPublicProto where T : _ConstraintThatIsNotPartOfTheAPIOfThisLibrary {}
107108// CHECK: extension lazy_typecheck.PublicStructIndirectlyConformingToPublicProto : lazy_typecheck.PublicProto {}
You can’t perform that action at this time.
0 commit comments