Skip to content

Commit c5e307d

Browse files
author
Benjamin Driscoll
committed
Add named opaque type test cases for patterns and subscripts
1 parent deb0457 commit c5e307d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test/type/opaque_experimental.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,10 @@ func f4() async -> <T> () { }
1010
func g0() -> <T> { } // expected-error{{expected type for function result}}
1111
func g1() -> async <T> () { } // expected-error{{'async' may only occur before '->'}}
1212
func g2() -> <T> () async { } // expected-error{{'async' may only occur before '->'}}
13+
14+
let x0: <T> Int = 1
15+
var x1: <T> (Int, Int) = (1, 1)
16+
var x2: <T> (<U> Int, Int) = (1, 1) // expected-error{{expected type}} expected-error{{cannot convert value of type '(Int, Int)' to specified type 'Int'}}
17+
for _: <T> Int in [1, 2, 3] { }
18+
19+
struct S0 { subscript(i: Int) -> <T> Int { 1 } }

0 commit comments

Comments
 (0)