Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions include/swift/AST/DiagnosticsSema.def
Original file line number Diff line number Diff line change
Expand Up @@ -7154,9 +7154,7 @@ ERROR(macro_undefined,PointsToFirstBadToken,
"no macro named %0", (Identifier))
ERROR(external_macro_not_found,none,
"external macro implementation type '%0.%1' could not be found for "
"macro %2; the type must be public and provided by a macro target in a "
"Swift package, or via '-plugin-path' or '-load-plugin-library'",
(StringRef, StringRef, DeclName))
"macro %2", (StringRef, StringRef, DeclName))
ERROR(macro_must_be_defined,none,
"macro %0 requires a definition", (DeclName))
ERROR(external_macro_outside_macro_definition,none,
Expand Down
4 changes: 2 additions & 2 deletions test/Macros/macro_plugin_broken.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
// RUN: c-index-test -read-diagnostics %t/macro_expand.dia 2>&1 | %FileCheck -check-prefix CHECK %s

// CHECK: (null):0:0: warning: compiler plugin not loaded: {{.+}}broken-plugin; failed to initialize
// CHECK: test.swift:1:33: warning: external macro implementation type 'TestPlugin.FooMacro' could not be found for macro 'fooMacro';
// CHECK: test.swift:4:7: error: external macro implementation type 'TestPlugin.FooMacro' could not be found for macro 'fooMacro';
// CHECK: test.swift:1:33: warning: external macro implementation type 'TestPlugin.FooMacro' could not be found for macro 'fooMacro'
// CHECK: test.swift:4:7: error: external macro implementation type 'TestPlugin.FooMacro' could not be found for macro 'fooMacro'
// CHECK: +-{{.+}}test.swift:1:33: note: 'fooMacro' declared here

//--- test.swift
Expand Down
2 changes: 1 addition & 1 deletion test/Macros/macros_diagnostics.swift
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ func shadow(a: Int, b: Int, stringify: Int) {
}

func testMissing() {
#missingMacro1("hello") // expected-error{{external macro implementation type 'MissingModule.MissingType' could not be found for macro 'missingMacro1'; the type must be public and provided by a macro target in a Swift package, or via '-plugin-path' or '-load-plugin-library'}}
#missingMacro1("hello") // expected-error{{external macro implementation type 'MissingModule.MissingType' could not be found for macro 'missingMacro1'}}
}

@freestanding(expression) macro undefined() // expected-error{{macro 'undefined()' requires a definition}}
Expand Down