You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: trunk/test/Constraints/conditionally_defined_types.swift
+20-20Lines changed: 20 additions & 20 deletions
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@ struct Z2: AssociatedType {
15
15
}
16
16
17
17
structSameType<T>{}
18
-
extensionSameTypewhere T ==X{
18
+
extensionSameTypewhere T ==X{ // expected-note 5 {{where 'T' = 'Y'}}
19
19
typealiasTypeAlias1=T
20
20
typealiasTypeAlias2=Y
21
21
typealiasTypeAlias3<U>=(T,U) // expected-note {{requirement specified as 'T' == 'X' [with T = Y]}}
@@ -36,20 +36,20 @@ let _ = SameType<X>.Decl3.self
36
36
let _ =SameType<X>.Decl4<X>.self
37
37
let _ =SameType<X>.Decl5<X>.self
38
38
39
-
let _ =SameType<Y>.TypeAlias1.self // expected-error {{'SameType<Y>.TypeAlias1.Type' (aka 'X.Type') requires the types 'Y' and 'X' be equivalent}}
40
-
let _ =SameType<Y>.TypeAlias2.self // expected-error {{'SameType<Y>.TypeAlias2.Type' (aka 'Y.Type') requires the types 'Y' and 'X' be equivalent}}
39
+
let _ =SameType<Y>.TypeAlias1.self // expected-error {{referencing type alias 'TypeAlias1' on 'SameType' requires the types 'Y' and 'X' be equivalent}}
40
+
let _ =SameType<Y>.TypeAlias2.self // expected-error {{referencing type alias 'TypeAlias2' on 'SameType' requires the types 'Y' and 'X' be equivalent}}
41
41
let _ =SameType<Y>.TypeAlias3<X>.self // expected-error {{'SameType<Y>.TypeAlias3' requires the types 'Y' and 'X' be equivalent}}
42
-
let _ =SameType<Y>.Decl1.self // expected-error {{'SameType<Y>.Decl1.Type' requires the types 'Y' and 'X' be equivalent}}
43
-
let _ =SameType<Y>.Decl2.self // expected-error {{'SameType<Y>.Decl2.Type' requires the types 'Y' and 'X' be equivalent}}
44
-
let _ =SameType<Y>.Decl3.self // expected-error {{'SameType<Y>.Decl3.Type' requires the types 'Y' and 'X' be equivalent}}
42
+
let _ =SameType<Y>.Decl1.self // expected-error {{referencing struct 'Decl1' on 'SameType' requires the types 'Y' and 'X' be equivalent}}
43
+
let _ =SameType<Y>.Decl2.self // expected-error {{referencing enum 'Decl2' on 'SameType' requires the types 'Y' and 'X' be equivalent}}
44
+
let _ =SameType<Y>.Decl3.self // expected-error {{referencing class 'Decl3' on 'SameType' requires the types 'Y' and 'X' be equivalent}}
45
45
let _ =SameType<Y>.Decl4<X>.self // expected-error {{'SameType<Y>.Decl4' requires the types 'Y' and 'X' be equivalent}}
46
46
let _ =SameType<Y>.Decl5<X>.self // expected-error {{'SameType<Y>.Decl5' requires the types 'Y' and 'X' be equivalent}}
47
47
48
-
extensionSameType:AssociatedTypewhere T ==X{}
48
+
extensionSameType:AssociatedTypewhere T ==X{} // expected-note {{where 'T' = 'Y'}}
49
49
50
50
// (Y first here, because there were issues caused by running associated type
51
51
// inference for the first time)
52
-
let _ =SameType<Y>.T.self // expected-error {{'SameType<Y>.T.Type' (aka 'X.Type') requires the types 'Y' and 'X' be equivalent}}
52
+
let _ =SameType<Y>.T.self // expected-error {{referencing type alias 'T' on 'SameType' requires the types 'Y' and 'X' be equivalent}}
typealiasTypeAlias3<U>=(T,U) // expected-note {{requirement specified as 'T' == 'X' [with T = Y]}}
@@ -113,16 +113,16 @@ let _ = SameType<X>.Decl1.Decl3.self
113
113
let _ =SameType<X>.Decl1.Decl4<X>.self
114
114
let _ =SameType<X>.Decl1.Decl5<X>.self
115
115
116
-
let _ =SameType<Y>.Decl1.TypeAlias1.self // expected-error {{'SameType<Y>.Decl1.TypeAlias1.Type' (aka 'X.Type') requires the types 'Y' and 'X' be equivalent}}
117
-
let _ =SameType<Y>.Decl1.TypeAlias2.self // expected-error {{'SameType<Y>.Decl1.TypeAlias2.Type' (aka 'Y.Type') requires the types 'Y' and 'X' be equivalent}}
116
+
let _ =SameType<Y>.Decl1.TypeAlias1.self // expected-error {{referencing type alias 'TypeAlias1' on 'SameType.Decl1' requires the types 'Y' and 'X' be equivalent}}
117
+
let _ =SameType<Y>.Decl1.TypeAlias2.self // expected-error {{referencing type alias 'TypeAlias2' on 'SameType.Decl1' requires the types 'Y' and 'X' be equivalent}}
118
118
let _ =SameType<Y>.Decl1.TypeAlias3<X>.self // expected-error {{'SameType<Y>.Decl1.TypeAlias3' requires the types 'Y' and 'X' be equivalent}}
119
-
let _ =SameType<Y>.Decl1.Decl1.self // expected-error {{'SameType<Y>.Decl1.Decl1.Type' requires the types 'Y' and 'X' be equivalent}}
120
-
let _ =SameType<Y>.Decl1.Decl2.self // expected-error {{'SameType<Y>.Decl1.Decl2.Type' requires the types 'Y' and 'X' be equivalent}}
121
-
let _ =SameType<Y>.Decl1.Decl3.self // expected-error {{'SameType<Y>.Decl1.Decl3.Type' requires the types 'Y' and 'X' be equivalent}}
119
+
let _ =SameType<Y>.Decl1.Decl1.self // expected-error {{referencing struct 'Decl1' on 'SameType.Decl1' requires the types 'Y' and 'X' be equivalent}}
120
+
let _ =SameType<Y>.Decl1.Decl2.self // expected-error {{referencing enum 'Decl2' on 'SameType.Decl1' requires the types 'Y' and 'X' be equivalent}}
121
+
let _ =SameType<Y>.Decl1.Decl3.self // expected-error {{referencing class 'Decl3' on 'SameType.Decl1' requires the types 'Y' and 'X' be equivalent}}
122
122
let _ =SameType<Y>.Decl1.Decl4<X>.self // expected-error {{'SameType<Y>.Decl1.Decl4' requires the types 'Y' and 'X' be equivalent}}
123
123
let _ =SameType<Y>.Decl1.Decl5<X>.self // expected-error {{'SameType<Y>.Decl1.Decl5' requires the types 'Y' and 'X' be equivalent}}
124
124
125
-
extensionSameType.Decl4where U ==X{
125
+
extensionSameType.Decl4where U ==X{ // expected-note 5 {{where 'U' = 'Y'}}
126
126
typealiasTypeAlias1=T
127
127
typealiasTypeAlias2=Y
128
128
typealiasTypeAlias3<V>=(T,U,V) // expected-note {{requirement specified as 'U' == 'X' [with U = Y]}}
@@ -145,12 +145,12 @@ let _ = SameType<X>.Decl4<X>.Decl3.self
145
145
let _ =SameType<X>.Decl4<X>.Decl4<X>.self
146
146
let _ =SameType<X>.Decl4<X>.Decl5<X>.self
147
147
148
-
let _ =SameType<X>.Decl4<Y>.TypeAlias1.self // expected-error {{'SameType<X>.Decl4<Y>.TypeAlias1.Type' (aka 'X.Type') requires the types 'Y' and 'X' be equivalent}}
149
-
let _ =SameType<X>.Decl4<Y>.TypeAlias2.self // expected-error {{'SameType<X>.Decl4<Y>.TypeAlias2.Type' (aka 'Y.Type') requires the types 'Y' and 'X' be equivalent}}
148
+
let _ =SameType<X>.Decl4<Y>.TypeAlias1.self // expected-error {{referencing type alias 'TypeAlias1' on 'SameType.Decl4' requires the types 'Y' and 'X' be equivalent}}
149
+
let _ =SameType<X>.Decl4<Y>.TypeAlias2.self // expected-error {{referencing type alias 'TypeAlias2' on 'SameType.Decl4' requires the types 'Y' and 'X' be equivalent}}
150
150
let _ =SameType<X>.Decl4<Y>.TypeAlias3<X>.self // expected-error {{'SameType<X>.Decl4<Y>.TypeAlias3' requires the types 'Y' and 'X' be equivalent}}
151
-
let _ =SameType<X>.Decl4<Y>.Decl1.self // expected-error {{'SameType<X>.Decl4<Y>.Decl1.Type' requires the types 'Y' and 'X' be equivalent}}
152
-
let _ =SameType<X>.Decl4<Y>.Decl2.self // expected-error {{'SameType<X>.Decl4<Y>.Decl2.Type' requires the types 'Y' and 'X' be equivalent}}
153
-
let _ =SameType<X>.Decl4<Y>.Decl3.self // expected-error {{'SameType<X>.Decl4<Y>.Decl3.Type' requires the types 'Y' and 'X' be equivalent}}
151
+
let _ =SameType<X>.Decl4<Y>.Decl1.self // expected-error {{referencing struct 'Decl1' on 'SameType.Decl4' requires the types 'Y' and 'X' be equivalent}}
152
+
let _ =SameType<X>.Decl4<Y>.Decl2.self // expected-error {{referencing enum 'Decl2' on 'SameType.Decl4' requires the types 'Y' and 'X' be equivalent}}
153
+
let _ =SameType<X>.Decl4<Y>.Decl3.self // expected-error {{referencing class 'Decl3' on 'SameType.Decl4' requires the types 'Y' and 'X' be equivalent}}
154
154
let _ =SameType<X>.Decl4<Y>.Decl4<X>.self // expected-error {{'SameType<X>.Decl4<Y>.Decl4' requires the types 'Y' and 'X' be equivalent}}
155
155
let _ =SameType<X>.Decl4<Y>.Decl5<X>.self // expected-error {{'SameType<X>.Decl4<Y>.Decl5' requires the types 'Y' and 'X' be equivalent}}
// expected-note@-1 {{candidate requires that the types 'Any' and 'Float' be equivalent (requirement specified as 'T.R' == 'Float' [with T = S27515965])}}
251
+
// expected-note@-1 {{where 'T.R' = 'Any'}}
252
252
}
253
253
254
254
func test(x:S27515965)->V27515965{
255
255
returnV27515965(x)
256
-
// expected-error@-1 {{cannot invoke initializer for type 'init(_:)' with an argument list of type '(S27515965)'}}
256
+
// expected-error@-1 {{initializer 'init' requires the types 'Any' and 'Float' be equivalent}}
returnVictory(magify(pair)) // expected-error {{cannot convert return expression of type 'Victory<(Int, Int)>' to return type 'Victory<(x: Int, y: Int)>'}}
172
+
returnVictory(magify(pair)) // expected-error {{initializer 'init' requires the types '(x: Int, y: Int)' and '(Int, Int)' be equivalent}}
// expected-note@-1 {{candidate requires that the types 'Int' and 'Double' be equivalent (requirement specified as 'A.Element' == 'B.Element' [with A = IndexingIterator<[Int]>, B = IndexingIterator<[Double]>])}}
// expected-error@-1 {{cannot invoke 'testEqualIterElementTypes(_:_:)' with an argument list of type '(IndexingIterator<[Int]>, IndexingIterator<[Double]>)'}}
226
+
// expected-error@-1 {{global function 'testEqualIterElementTypes' requires the types 'Int' and 'Double' be equivalent}}
0 commit comments