File tree Expand file tree Collapse file tree 1 file changed +57
-0
lines changed
validation-test/compiler_crashers_2_fixed Expand file tree Collapse file tree 1 file changed +57
-0
lines changed Original file line number Diff line number Diff line change
1
+ // RUN: %target-swift-frontend -emit-ir -o %t.ll %s
2
+
3
+ // Just make sure we don't crash.
4
+
5
+ protocol Publicable {
6
+ associatedtype PublicModel
7
+
8
+ func publicized( ) -> PublicModel
9
+ }
10
+
11
+
12
+ protocol WithReturnType {
13
+ associatedtype MainType
14
+ associatedtype ReturnType
15
+
16
+ func returnTheThing( )
17
+ }
18
+
19
+ extension WithReturnType where MainType: Publicable {
20
+ typealias ReturnType = MainType . PublicModel
21
+
22
+ func returnTheThing( ) {
23
+ print ( " publicable " )
24
+ }
25
+ }
26
+
27
+ extension WithReturnType {
28
+ func returnTheThing( ) {
29
+ print ( " not publicable " )
30
+ }
31
+ }
32
+
33
+ extension String : Publicable {
34
+ struct PublicString {
35
+ let inner : String
36
+
37
+ init ( str: String ) {
38
+ self . inner = " Public: \( str) "
39
+ }
40
+ }
41
+
42
+ func publicized( ) -> PublicString {
43
+ return PublicString ( str: self )
44
+ }
45
+ }
46
+
47
+ struct Controller < T> {
48
+
49
+ }
50
+
51
+ extension Controller : WithReturnType {
52
+ typealias MainType = T
53
+ }
54
+
55
+ let controller = Controller < String > ( )
56
+
57
+ controller. returnTheThing ( )
You can’t perform that action at this time.
0 commit comments