Files
swift-mirror/test/ClangModules/accessibility_framework.swift
Dmitri Hrybenko f43843f25c tests: use the new substitution for the mock SDK
This is required to correctly use the mock SDK when the SDK overlay is
built and tested separately.  (Otherwise, the mock SDK might not get
used, because the overlay SDK options would expand from the
%-substitution, appear first on the command line, and shadow the mock
SDK in the search path).

Swift SVN r25185
2015-02-11 18:57:29 +00:00

30 lines
1021 B
Swift

// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -parse -verify %s
// REQUIRES: OS=macosx
// REQUIRES: objc_interop
// The accessibility APIs are handled differently. A class might conform to both
// NSAccessibility (containing accessibility properties) and individual
// accessibility protocols (containing accessibility methods with the same
// names as the properties). This should not compile. To avoid the problem, we
// import setters and getters instead of the accessibility properties from
// NSAccessibility.
//
// radar://17509751
import AppKit
class A: NSView, NSAccessibilityButton {
override func accessibilityLabel() -> String? {return "Anna's button"}
override func accessibilityPerformPress() -> Bool {return true}
override func accessibilityParent() -> AnyObject? {return nil}
override func isAccessibilityFocused() -> Bool {return false}
}
class AA: NSView {
override func accessibilityPerformPress() -> Bool {return true}
}
let a = A()
print(a.accessibilityLabel())