Skip to content

Commit 92afc89

Browse files
committed
Use expected-error
1 parent 47ed6e7 commit 92afc89

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

include/swift/AST/DiagnosticsSema.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7327,7 +7327,7 @@ ERROR(macro_attached_to_invalid_decl,none,
73277327
"'%0' macro cannot be attached to %1 (%base2)",
73287328
(StringRef, DescriptiveDeclKind, const Decl *))
73297329
ERROR(macro_as_default_argument, none,
7330-
"non-built-in macro cannot be used as the default argument",
7330+
"non-built-in macro cannot be used as default argument",
73317331
())
73327332
ERROR(conformance_macro,none,
73337333
"conformance macros are replaced by extension macros",

test/Macros/macro_default_argument.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// RUN: %empty-directory(%t)
44
// RUN: %host-build-swift -swift-version 5 -emit-library -o %t/%target-library-name(MacroDefinition) -module-name=MacroDefinition %S/Inputs/syntax_macro_definitions.swift -g -no-toolchain-stdlib-rpath
55

6-
// RUN: not %target-build-swift -typecheck -swift-version 5 -load-plugin-library %t/%target-library-name(MacroDefinition) %s 2>&1 | %FileCheck %s
6+
// RUN: %target-typecheck-verify-swift -swift-version 5 -load-plugin-library %t/%target-library-name(MacroDefinition) %s
77

88
@freestanding(expression)
99
macro MagicLine() -> Int = #externalMacro(module: "MacroDefinition", type: "MagicLineMacro")
@@ -24,9 +24,9 @@ func builtInOkay(line: Int = #line) {
2424
print(line)
2525
}
2626

27-
// CHECK: non-built-in macro cannot be used as the default argument
27+
// expected-error@+1{{non-built-in macro cannot be used as default argument}}
2828
func asDefaultArgument(line: Int = #MagicLine) {
2929
print(line)
3030
}
3131

32-
testAsDefaultArgument()
32+
asDefaultArgument()

0 commit comments

Comments
 (0)