Files
swift-mirror/stdlib/objc/Foundation/MixedStringNSStringOperations.swift.gyb
Maxwell Swadling 6cea1939e2 removed @transparent from unavailable functions
Swift SVN r24760
2015-01-27 22:18:37 +00:00

36 lines
1.2 KiB
Swift

//===--- MixedStringNSStringOperations.swift.gyb --------------*- swift -*-===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2015 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See http://swift.org/LICENSE.txt for license information
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
//
// Mixed-type comparisons between String and NSString.
// Since the compiler will implicitly bridge String to NSString, these more
// refined overloads exist to disable invalid bridging from happening.
// For example, swiftString < nsString will bridge swiftString to NSString
// and perform incorrect unicode comparison.
//
% for op in [ '==', '!=', '<', '<=', '>=', '>' ]:
@availability(*, unavailable,
message="Comparing Swift.String and NSString is ambiguous")
public func ${op} (lhs: String, rhs: NSString) -> Bool {
fatalError("impossible")
}
@availability(*, unavailable,
message="Comparing Swift.String and NSString is ambiguous")
public func ${op} (lhs: NSString, rhs: String) -> Bool {
fatalError("impossible")
}
% end