Files
swift-mirror/test/attr/feature_requirement.swift
Pavel Yaskevich 01e3bd0636 [AST] Disconnect @execution(...) attribute from the feature flag
The attribute has to be available without feature flag on so that
it could be adopted preemptively, before the behavior change.
2025-02-05 00:16:57 -08:00

17 lines
794 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 ABIAttribute
// 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.
@abi(func fn())
func fn() {} // expected-disabled-error@-1 {{'abi' attribute is only valid when experimental feature ABIAttribute is enabled}}
#if hasAttribute(abi)
#error("does have @abi") // expected-enabled-error {{does have @abi}}
#else
#error("doesn't have @abi") // expected-disabled-error {{doesn't have @abi}}
#endif