-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #64538 from tshortli/relax-unsafe-main-actor-avail…
…ability-checking-5.8 [5.8] Sema: Relax availability checking for `@MainActor`
- Loading branch information
Showing
10 changed files
with
78 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// RUN: %target-typecheck-verify-swift | ||
|
||
// REQUIRES: concurrency | ||
|
||
// This test is meant to verify that a @MainActor constraint is accepted without | ||
// any availability restrictions for all targets. | ||
|
||
@MainActor | ||
struct AlwaysAvailable {} | ||
|
||
@MainActor(unsafe) | ||
struct AlwaysAvailableUnsafe {} | ||
|
||
@available(SwiftStdlib 5.1, *) | ||
@MainActor | ||
struct AvailableSwift5_1 {} | ||
|
||
@available(SwiftStdlib 5.1, *) | ||
@MainActor(unsafe) | ||
struct AvailableSwift5_1Unsafe {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// RUN: %empty-directory(%t) | ||
// RUN: %target-swift-emit-module-interface(%t/Library.swiftinterface) %s -module-name Library | ||
// RUN: %target-swift-typecheck-module-from-interface(%t/Library.swiftinterface) -module-name Library | ||
// RUN: %FileCheck %s < %t/Library.swiftinterface | ||
|
||
// REQUIRES: OS=macosx | ||
|
||
import AppKit | ||
|
||
// CHECK: @objc @_inheritsConvenienceInitializers @_Concurrency.MainActor(unsafe) public class Subclass : AppKit.NSView { | ||
public class Subclass: NSView { | ||
// CHECK: @_Concurrency.MainActor(unsafe) @objc override dynamic public init(frame frameRect: Foundation.NSRect) | ||
// CHECK: @_Concurrency.MainActor(unsafe) @objc required dynamic public init?(coder: Foundation.NSCoder) | ||
} |