Files
swift-mirror/test/ModuleInterface/experimental-features.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

26 lines
913 B
Swift

// RUN: %empty-directory(%t)
// RUN: split-file %s %t
// Building a module from this interface should always succeed, even though
// ParserRoundTrip is an experimental feature that is not enabled in production
// compilers.
// RUN: %target-swift-frontend -typecheck %t/Client.swift -I %t
// RUN: %target-swift-frontend -compile-module-from-interface -module-name ExperimentalFeatures -o /dev/null %t/ExperimentalFeatures.swiftinterface -verify
// RUN: %target-swift-frontend -typecheck-module-from-interface -module-name ExperimentalFeatures %t/ExperimentalFeatures.swiftinterface -verify
//--- ExperimentalFeatures.swiftinterface
// swift-interface-format-version: 1.0
// swift-module-flags: -module-name ExperimentalFeatures -enable-experimental-feature ParserRoundTrip
import Swift
extension Int {
public static var fortytwo: Int = 42
}
//--- Client.swift
import ExperimentalFeatures
_ = Int.fortytwo