mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Syntactically verify that initializer expressions of '@const' variables and argument expressions to '@const' parameters consist strictly of syntactically-verifiable set of basic values and operations
11 lines
589 B
Swift
11 lines
589 B
Swift
// Constant globals on strings
|
|
// REQUIRES: swift_feature_CompileTimeValues
|
|
// REQUIRES: swift_feature_CompileTimeValuesPreview
|
|
// REQUIRES: rdar146953748
|
|
// RUN: %target-swift-frontend -emit-ir -primary-file %s -parse-as-library -enable-experimental-feature CompileTimeValues -enable-experimental-feature CompileTimeValuesPreview
|
|
// RUN: %target-swift-frontend -emit-ir -primary-file %s -parse-as-library -enable-experimental-feature CompileTimeValues
|
|
|
|
@const let constGlobal1: String = "hello"
|
|
@const let constGlobal2: StaticString = "hello"
|
|
@const let constGlobal3: Int = "hello".count
|