Skip to content

Commit 7978f59

Browse files
committed
[Diagnostics] Reduce missing external macro diagnostic
This is a very large diagnostic, where the second half is mostly aimed at macro authors rather than clients. Cut it down to the base diagnostic. Resolves rdar://113646544.
1 parent 3f13d15 commit 7978f59

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

include/swift/AST/DiagnosticsSema.def

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7113,9 +7113,7 @@ ERROR(macro_undefined,PointsToFirstBadToken,
71137113
"no macro named %0", (Identifier))
71147114
ERROR(external_macro_not_found,none,
71157115
"external macro implementation type '%0.%1' could not be found for "
7116-
"macro %2; the type must be public and provided by a macro target in a "
7117-
"Swift package, or via '-plugin-path' or '-load-plugin-library'",
7118-
(StringRef, StringRef, DeclName))
7116+
"macro %2", (StringRef, StringRef, DeclName))
71197117
ERROR(macro_must_be_defined,none,
71207118
"macro %0 requires a definition", (DeclName))
71217119
ERROR(external_macro_outside_macro_definition,none,

test/Macros/macros_diagnostics.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ func shadow(a: Int, b: Int, stringify: Int) {
136136
}
137137

138138
func testMissing() {
139-
#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'}}
139+
#missingMacro1("hello") // expected-error{{external macro implementation type 'MissingModule.MissingType' could not be found for macro 'missingMacro1'}}
140140
}
141141

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

0 commit comments

Comments
 (0)