File tree Expand file tree Collapse file tree 2 files changed +43
-0
lines changed Expand file tree Collapse file tree 2 files changed +43
-0
lines changed Original file line number Diff line number Diff line change
1
+ // RUN: %empty-directory(%t)
2
+ // RUN: %target-swift-frontend %s -disable-availability-checking -emit-ir | %FileCheck %s
3
+
4
+ // REQUIRES: objc_interop
5
+
6
+ protocol MyProtocol { }
7
+
8
+ func returnsClass1( ) -> some MyProtocol {
9
+ class MyClass1 : MyProtocol { }
10
+ return MyClass1 ( )
11
+ }
12
+
13
+ var returnsClass2 : some MyProtocol {
14
+ class MyClass2 : MyProtocol { }
15
+ return MyClass2 ( )
16
+ }
17
+
18
+ // CHECK: @_DATA__TtCF41objc_runtime_name_local_class_opaque_type13returnsClass1FT_QuL_8MyClass1 = internal constant
19
+ // CHECK: @_DATA__TtCF41objc_runtime_name_local_class_opaque_typeg13returnsClass2QuL_8MyClass2 = internal constant
Original file line number Diff line number Diff line change
1
+ // RUN: %empty-directory(%t)
2
+ // RUN: %target-build-swift -Xfrontend -disable-availability-checking %s -o %t/a.out
3
+ // RUN: %target-run %t/a.out | %FileCheck %s
4
+
5
+ // REQUIRES: executable_test
6
+ // REQUIRES: objc_interop
7
+
8
+ protocol MyProtocol { }
9
+
10
+ func returnsClass1( ) -> some MyProtocol {
11
+ class MyClass1 : MyProtocol { }
12
+ return MyClass1 ( )
13
+ }
14
+
15
+ var returnsClass2 : some MyProtocol {
16
+ class MyClass2 : MyProtocol { }
17
+ return MyClass2 ( )
18
+ }
19
+
20
+ print ( returnsClass1 ( ) )
21
+ // CHECK: a.(unknown context at ${{[0-9a-z]+}}).(unknown context at ${{[0-9a-z]+}}).MyClass1
22
+
23
+ print ( returnsClass2)
24
+ // CHECK: a.(unknown context at ${{[0-9a-z]+}}).(unknown context at ${{[0-9a-z]+}}).MyClass2
You can’t perform that action at this time.
0 commit comments