We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d49d054 commit dbb5c02Copy full SHA for dbb5c02
test/decl/nested/type_in_extension.swift
@@ -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