Skip to content

Commit 4050799

Browse files
committed
Another test whose diagnostics improved
1 parent 4672c11 commit 4050799

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/Generics/existential_restrictions.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,17 +53,17 @@ class GP<T : P> {}
5353
class GOP<T : OP> {}
5454
class GCP<T : CP> {}
5555
class GSP<T : SP> {}
56-
class GAO<T : AnyObject> {}
56+
class GAO<T : AnyObject> {} // expected-note 2{{requirement specified as 'T' : 'AnyObject'}}
5757

5858
func blackHole(_ t: Any) {}
5959

6060
func testBindExistential() {
6161
blackHole(GP<P>()) // expected-error{{using 'P' as a concrete type conforming to protocol 'P' is not supported}}
6262
blackHole(GOP<OP>())
6363
blackHole(GCP<CP>()) // expected-error{{using 'CP' as a concrete type conforming to protocol 'CP' is not supported}}
64-
blackHole(GAO<P>()) // expected-error{{'P' is not convertible to 'AnyObject'}}
64+
blackHole(GAO<P>()) // expected-error{{'GAO' requires that 'P' be a class type}}
6565
blackHole(GAO<OP>())
66-
blackHole(GAO<CP>()) // expected-error{{'CP' is not convertible to 'AnyObject'}}
66+
blackHole(GAO<CP>()) // expected-error{{'GAO' requires that 'CP' be a class type}}
6767
blackHole(GSP<SP>()) // expected-error{{'SP' cannot be used as a type conforming to protocol 'SP' because 'SP' has static requirements}}
6868
blackHole(GAO<AnyObject>())
6969
}

0 commit comments

Comments
 (0)