Files
swift-mirror/test/Frontend/experimental-features-no-asserts.swift
Allan Shortlidge 12fccfc4e0 Frontend: Really allow any experimental feature when compiling a module interface.
The fix for https://github.com/apple/swift/pull/72632 was not sufficient
because when modules are built from textual interface that happens in a
sub-invocation which does not have typecheck-from-interface or
compile-from-interface requested action. Instead of checking a requested
action, set a language option to control whether non-production experimental
features are allowed.

Resolves rdar://125561443
2024-03-28 14:48:15 -07:00

15 lines
596 B
Swift

// This test verifies that command line parsing restricts use of features that
// are not allowed non-production compilers.
// REQUIRES: no_asserts
// 'AccessLevelOnImport' is allowed in production
// RUN: %target-swift-frontend -typecheck %s -enable-experimental-feature AccessLevelOnImport -verify
// 'ParserValidation' is NOT allowed in production
// RUN: not %target-swift-frontend -typecheck %s -enable-experimental-feature ParserValidation 2>&1 | %FileCheck %s
// CHECK: <unknown>:0: error: experimental feature 'ParserValidation' cannot be enabled in production compiler
import Swift