Files
swift-mirror/test/Serialization/isolated_conformance.swift
Doug Gregor 5e29333d6b [SE-0470] Enable isolated conformances by default
The IsolatedConformances feature moves to a normal, supported feature.
Remove all of the experimental-feature flags on test cases and such.

The InferIsolatedConformances feature moves to an upcoming feature for
Swift 7. This should become an adoptable feature, adding "nonisolated"
where needed.

(cherry picked from commit 3380331e7e)
2025-04-14 16:38:22 -07:00

16 lines
616 B
Swift

// RUN: %empty-directory(%t)
// RUN: %target-swift-frontend -emit-module -target %target-swift-5.1-abi-triple -swift-version 6 -o %t/def_isolated_conformance.swiftmodule %S/Inputs/def_isolated_conformance.swift
// RUN: %target-swift-frontend -typecheck -verify -target %target-swift-5.1-abi-triple -swift-version 6 %s -I %t
// REQUIRES: concurrency
import def_isolated_conformance
func acceptMyProtocol(_: some MyProtocol) { }
nonisolated func f(mc: MyClass) {
acceptMyProtocol(mc)
// expected-error@-1{{main actor-isolated conformance of 'MyClass' to 'MyProtocol' cannot be used in nonisolated context}}
}