Skip to content

Commit 22cdba4

Browse files
committed
Sema: Add missing test case for 63a5731
1 parent 19af3bc commit 22cdba4

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// RUN: %target-typecheck-verify-swift %s
2+
3+
@attached(member) @attached(peer)
4+
public macro Foo(_: any P) = #externalMacro(module: "FooMacros", type: "FooMacro")
5+
// expected-warning@-1 {{external macro implementation type 'FooMacros.FooMacro' could not be found for macro 'Foo'; plugin for module 'FooMacros' not found}}
6+
// expected-note@-2 2 {{'Foo' declared here}}
7+
8+
public protocol P {}
9+
10+
@Foo(S.s)
11+
struct A {
12+
// expected-error@-1 2 {{external macro implementation type 'FooMacros.FooMacro' could not be found for macro 'Foo'; plugin for module 'FooMacros' not found}}
13+
func a() {}
14+
}
15+
16+
extension A {
17+
struct Nested {}
18+
}
19+
20+
// Binding this extension must not trigger macro expansion, because that
21+
// performs a qualified lookup of S.s, which fails because the extension
22+
// of P declared below has not been bound yet.
23+
extension A.Nested {}
24+
25+
struct S: P {}
26+
27+
extension P where Self == S {
28+
static var s: Self { Self() }
29+
}

0 commit comments

Comments
 (0)