Files
swift-mirror/test/ModuleInterface/isolated_deinit.swift
Pavel Yaskevich 9b8e53c0a1 [Concurrency] Check whether @preconcurrency is supported before adding it
Don't trasfer "preconcurrency" from isolation onto a declaration if
the declaration doesn't support it. This is especially important for
`MainActor` by default mode where each `@MainActor` injection site
gets marked as `@preconcurrency` implicitly in pre-6 language modes.

Resolves: https://github.com/swiftlang/swift/issues/85564
2026-02-03 10:29:59 -08:00

34 lines
802 B
Swift

// RUN: %target-swift-frontend -emit-module %s \
// RUN: -module-name A -swift-version 5 \
// RUN: -disable-availability-checking \
// RUN: -enable-library-evolution \
// RUN: -emit-module-path %t/A.swiftmodule \
// RUN: -emit-module-interface-path %t/A.swiftinterface
// RUN: %FileCheck %s < %t/A.swiftinterface
// RUN: %target-swift-typecheck-module-from-interface(%t/A.swiftinterface)
// REQUIRES: concurrency
// CHECK: @_Concurrency.MainActor @preconcurrency public class C1 {
// CHECK: {{(@objc )?}} isolated deinit
// CHECK: }
@MainActor
@preconcurrency
public class C1 {
isolated deinit {
}
}
// CHECK: @preconcurrency public class C2 {
// CHECK: {{(@objc )?}} @_Concurrency.MainActor deinit
// CHECK: }
@preconcurrency
public class C2 {
@MainActor deinit {
}
}