Skip to content

Commit 6e94080

Browse files
committed
AST: Quote attributes more consistently in DiagnosticsCommon.def
1 parent 7b92a8f commit 6e94080

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

include/swift/AST/DiagnosticsCommon.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ ERROR(require_literal_initializer_for_literal,none,
8787
"_const let should be initialized with a literal value", ())
8888

8989
ERROR(require_const_initializer_for_const,none,
90-
"@const value should be initialized with a compile-time value", ())
90+
"'@const' value should be initialized with a compile-time value", ())
9191

9292
ERROR(require_const_arg_for_parameter,none,
9393
"expected a compile-time value argument for a '@const' parameter", ())

test/ConstValues/DiagModules.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ public func foo() -> Int {
1717
import MyModule
1818

1919
@const let constGlobal1: Int = foo()
20-
// expected-error@-1 {{@const value should be initialized with a compile-time value}}
20+
// expected-error@-1 {{'@const' value should be initialized with a compile-time value}}
2121
// expected-error@-2 {{global variable must be a compile-time constant}} // Remove this once we common out the diagnostics

test/ConstValues/DiagNotConst.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
// RUN: %target-swift-frontend -emit-ir -primary-file %s -parse-as-library -verify -enable-experimental-feature CompileTimeValues
44

55
@const let a: Bool = Bool.random()
6-
// expected-error@-1 {{@const value should be initialized with a compile-time value}}
6+
// expected-error@-1 {{'@const' value should be initialized with a compile-time value}}
77
// expected-error@-2 {{global variable must be a compile-time constant}} // Remove this once we common out the diagnostics
88

99
func foo() -> Int {
1010
return 42 * Int.random(in: 0 ..< 10)
1111
}
1212

1313
@const let b: Int = foo()
14-
// expected-error@-1 {{@const value should be initialized with a compile-time value}}
14+
// expected-error@-1 {{'@const' value should be initialized with a compile-time value}}
1515
// expected-error@-2 {{global variable must be a compile-time constant}} // Remove this once we common out the diagnostics

0 commit comments

Comments
 (0)