Skip to content

Commit dbb5c02

Browse files
committed
Sema: Add a test I wrote a few days ago and forgot to check in
1 parent d49d054 commit dbb5c02

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// RUN: %target-parse-verify-swift
2+
3+
struct G<T> {}
4+
5+
extension G {
6+
struct H<U> { } // expected-error {{type 'H' cannot be nested in extension of generic type 'G'}}
7+
}
8+
9+
extension { // expected-error {{expected type name in extension declaration}}
10+
struct S<T> {
11+
func foo(t: T) {} // expected-error {{use of undeclared type 'T'}}
12+
}
13+
14+
class M : S {} // expected-error {{use of undeclared type 'S'}}
15+
16+
protocol P { // expected-error {{protocol 'P' cannot be nested inside another declaration}}
17+
associatedtype A
18+
}
19+
}

0 commit comments

Comments
 (0)