mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
This change introduces a new compilation target platform to the Swift compiler - visionOS. - Changes to the compiler build infrastrucuture to support building compiler-adjacent artifacts and test suites for the new target. - Addition of the new platform kind definition. - Support for the new platform in language constructs such as compile-time availability annotations or runtime OS version queries. - Utilities to read out Darwin platform SDK info containing platform mapping data. - Utilities to support re-mapping availability annotations from iOS to visionOS (e.g. 'updateIntroducedPlatformForFallback', 'updateDeprecatedPlatformForFallback', 'updateObsoletedPlatformForFallback'). - Additional tests exercising platform-specific availability handling and availability re-mapping fallback code-path. - Changes to existing test suite to accomodate the new platform.
33 lines
1.8 KiB
Swift
33 lines
1.8 KiB
Swift
// RUN: not %target-build-swift -typecheck %s 2>&1 | %FileCheck -check-prefix=CHECK-%target-os %s
|
|
// REQUIRES: objc_interop
|
|
// REQUIRES: executable_test
|
|
|
|
class IBActionWrapperTy {
|
|
@IBAction func nullary() {}
|
|
// CHECK-ios-NOT: attr_ibaction_ios.swift:[[@LINE-1]]
|
|
// CHECK-macosx: attr_ibaction_ios.swift:[[@LINE-2]]:18: error: @IBAction methods must have 1 argument
|
|
// CHECK-tvos-NOT: attr_ibaction_ios.swift:[[@LINE-3]]
|
|
// CHECK-watchos-NOT: attr_ibaction_ios.swift:[[@LINE-4]]
|
|
// CHECK-xros-NOT: attr_ibaction_ios.swift:[[@LINE-5]]
|
|
|
|
@IBAction func unary(_: AnyObject) {}
|
|
// CHECK-ios-NOT: attr_ibaction_ios.swift:[[@LINE-1]]
|
|
// CHECK-macosx-NOT: attr_ibaction_ios.swift:[[@LINE-2]]
|
|
// CHECK-tvos-NOT: attr_ibaction_ios.swift:[[@LINE-3]]
|
|
// CHECK-watchos-NOT: attr_ibaction_ios.swift:[[@LINE-4]]
|
|
// CHECK-xros-NOT: attr_ibaction_ios.swift:[[@LINE-5]]
|
|
|
|
@IBAction func binary(_: AnyObject, _: AnyObject) {}
|
|
// CHECK-ios-NOT: attr_ibaction_ios.swift:[[@LINE-1]]
|
|
// CHECK-macosx: attr_ibaction_ios.swift:[[@LINE-2]]:18: error: @IBAction methods must have 1 argument
|
|
// CHECK-tvos-NOT: attr_ibaction_ios.swift:[[@LINE-3]]
|
|
// CHECK-watchos-NOT: attr_ibaction_ios.swift:[[@LINE-4]]
|
|
// CHECK-xros-NOT: attr_ibaction_ios.swift:[[@LINE-5]]
|
|
|
|
@IBAction func ternary(_: AnyObject, _: AnyObject, _: AnyObject) {}
|
|
// CHECK-ios: attr_ibaction_ios.swift:[[@LINE-1]]:18: error: @IBAction methods must have at most 2 arguments
|
|
// CHECK-macosx: attr_ibaction_ios.swift:[[@LINE-2]]:18: error: @IBAction methods must have 1 argument
|
|
// CHECK-tvos: attr_ibaction_ios.swift:[[@LINE-3]]:18: error: @IBAction methods must have at most 2 arguments
|
|
// CHECK-watchos: attr_ibaction_ios.swift:[[@LINE-4]]:18: error: @IBAction methods must have at most 2 arguments
|
|
// CHECK-xros: attr_ibaction_ios.swift:[[@LINE-5]]:18: error: @IBAction methods must have at most 2 arguments
|