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: test/Generics/associated_types.swift
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -173,7 +173,7 @@ struct C<a : B> : B { // expected-error {{type 'C<a>' does not conform to protoc
173
173
174
174
// SR-511
175
175
protocolsr511{
176
-
typealias Foo // expected-warning {{use of 'typealias' to declare associated types is deprecated; use 'associatedtype' instead}}
176
+
typealias Foo // expected-error {{typealias is missing an assigned type; use 'associatedtype' to define an associated type requirement}}
177
177
}
178
178
179
179
associatedtypeFoo=Int // expected-error {{associated types can only be defined in a protocol; define a type or introduce a 'typealias' to satisfy an associated type requirement}}
Copy file name to clipboardExpand all lines: test/decl/typealias/typealias.swift
+8-10Lines changed: 8 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -29,8 +29,8 @@ struct MyType<TyA, TyB> {
29
29
30
30
protocol P {
31
31
associatedtypeX<T> // expected-error {{associated types may not have a generic parameter list}}
32
-
// FIXME Disabled until typealiases in protocols are entirely fixed
33
-
// typealias Y<T> // fixme-error {{expected '=' in typealias declaration}}
32
+
33
+
typealias Y<T> // expected-error {{expected '=' in typealias declaration}}
34
34
}
35
35
36
36
typealiasbasicTypealias=Int
@@ -148,8 +148,6 @@ extension C<Int> {} // expected-error {{constrained extension must be declared
148
148
149
149
150
150
// Allow typealias inside protocol, but don't allow it in where clauses (at least not yet)
151
-
// FIXME Disabled until typealiases in protocols are entirely fixed
152
-
/*
153
151
protocolCol{
154
152
associatedtypeElem
155
153
varelem:Elem{get}
@@ -229,23 +227,23 @@ protocol P2 {
229
227
associatedtypeB
230
228
}
231
229
232
-
func go3<T : P1, U : P2 where T.F == U.B>(_ x: T) -> U { // fixme-error {{typealias 'F' is too complex to be used as a generic constraint; use an associatedtype instead}} fixme-error {{'F' is not a member type of 'T'}}
230
+
func go3<T :P1, U :P2where T.F ==U.B>(_ x:T)->U{ // expected-error {{typealias 'F' is too complex to be used as a generic constraint; use an associatedtype instead}} expected-error {{'F' is not a member type of 'T'}}
233
231
}
234
232
235
233
// Specific diagnosis for things that look like Swift 2.x typealiases
236
234
protocol P3 {
237
-
typealias T // fixme-error {{typealias is missing an assigned type; use 'associatedtype' to define an associated type requirement}}
238
-
typealias U : P2 // fixme-error {{typealias is missing an assigned type; use 'associatedtype' to define an associated type requirement}}
235
+
typealias T // expected-error {{typealias is missing an assigned type; use 'associatedtype' to define an associated type requirement}}
236
+
typealias U : P2 // expected-error {{typealias is missing an assigned type; use 'associatedtype' to define an associated type requirement}}
239
237
240
-
associatedtype V : P2 = // fixme-error {{expected type in associatedtype declaration}}
238
+
associatedtypeV:P2= // expected-error {{expected type in associatedtype declaration}}
241
239
}
242
240
243
241
// Test for not crashing on self and recursive aliases
244
242
protocolP4{
245
243
typealiasX=Self
246
-
typealias Y = Self.Y // fixme-error {{type alias 'Y' circularly references itself}}
244
+
typealiasY=Self.Y // expected-error {{type alias 'Y' circularly references itself}}
0 commit comments