mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
This includes changing the feature name so that compilers with the experimental feature don’t accidentally pick up content that only works in the final version. Resolves rdar://150065196.
17 lines
811 B
Swift
17 lines
811 B
Swift
// RUN: %target-typecheck-verify-swift -parse-as-library -disable-experimental-parser-round-trip -verify-additional-prefix disabled-
|
|
// RUN: %target-typecheck-verify-swift -parse-as-library -verify-additional-prefix enabled- -enable-experimental-feature CompileTimeValues
|
|
|
|
// REQUIRES: asserts
|
|
|
|
// This test checks whether DECL_ATTR_FEATURE_REQUIREMENT is being applied correctly.
|
|
// It is expected to need occasional edits as experimental features are stabilized.
|
|
|
|
@const
|
|
public let x = 1 // expected-disabled-error@-1 {{'const' attribute is only valid when experimental feature CompileTimeValues is enabled}}
|
|
|
|
#if hasAttribute(const)
|
|
#error("does have @const") // expected-enabled-error {{does have @const}}
|
|
#else
|
|
#error("doesn't have @const") // expected-disabled-error {{doesn't have @const}}
|
|
#endif
|