Files
swift-mirror/test/attr/feature_requirement.swift
Becca Royal-Gordon e831274256 Make @abi non-experimental
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.
2025-05-08 18:28:34 -07:00

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