Skip to content

Commit eac4166

Browse files
authored
Merge pull request swiftlang#27054 from CodaFi/extensional-angst
2 parents 902da31 + 12b157e commit eac4166

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

test/attr/dynamicReplacement.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,14 @@ extension K {
5050
func replacement_finalFunction() {}
5151
}
5252

53+
extension undeclared { // expected-error{{use of undeclared type 'undeclared'}}
54+
@_dynamicReplacement(for: property)
55+
var replacement_property: Int { return 2 }
56+
57+
@_dynamicReplacement(for: func)
58+
func func2() -> Int { return 2 }
59+
}
60+
5361
extension P {
5462
@_dynamicReplacement(for: v)
5563
var replacement_v : Int {

test/decl/nested/type_in_extension.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ extension G {
88
}
99
}
1010

11-
extension G {
12-
struct S<T> { // expected-note {{generic type 'S' declared here}}
11+
extension { // expected-error {{expected type name in extension declaration}}
12+
struct S<T> {
1313
func foo(t: T) {}
1414
}
1515

16-
class M : S {} // expected-error {{reference to generic type 'G<T>.S' requires arguments in <...>}}
16+
class M : S {}
1717

18-
protocol P { // expected-error {{protocol 'P' cannot be nested inside another declaration}}
18+
protocol P {
1919
associatedtype A
2020
}
2121
}

0 commit comments

Comments
 (0)