mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
A parse-only option is needed for parse performance tracking and the current option also includes semantic analysis.
16 lines
636 B
Swift
16 lines
636 B
Swift
// RUN: %target-swift-frontend %s -typecheck -verify
|
|
|
|
// REQUIRES: objc_interop
|
|
|
|
import Foundation
|
|
|
|
func useUnavailable() {
|
|
var a = NSSimpleCString() // expected-error {{'NSSimpleCString' is unavailable}}
|
|
var b = NSConstantString() // expected-error {{'NSConstantString' is unavailable}}
|
|
}
|
|
|
|
func encode(_ string: String) {
|
|
_ = string.cString(using: NSUTF8StringEncoding) // expected-error {{'NSUTF8StringEncoding' has been renamed to 'String.Encoding.utf8'}} {{29-49=String.Encoding.utf8}}
|
|
let _: NSStringEncoding? = nil // expected-error {{'NSStringEncoding' has been renamed to 'String.Encoding'}} {{10-26=String.Encoding}}
|
|
}
|