mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
forced conversion to "_ -> T" if it will refine the type otherwise found by doing a non-contextual type check. This allows us to diagnose calls to non-function values with more specificity, e.g. adding another case were we recommend "do" when using bare braces. Swift SVN r31726
22 lines
624 B
Swift
22 lines
624 B
Swift
// RUN: %target-parse-verify-swift %clang-importer-sdk
|
|
|
|
// REQUIRES: objc_interop
|
|
|
|
import Darwin
|
|
import MachO
|
|
|
|
_ = nil as Fract? // expected-error{{use of undeclared type 'Fract'}}
|
|
_ = nil as Darwin.Fract? // okay
|
|
|
|
_ = 0 as OSErr
|
|
_ = noErr as OSStatus // noErr is from the overlay
|
|
_ = 0 as UniChar
|
|
|
|
_ = ProcessSerialNumber()
|
|
|
|
_ = 0 as Byte // expected-error {{use of undeclared type 'Byte'}} {{10-14=UInt8}}
|
|
Darwin.fakeAPIUsingByteInDarwin() as Int // expected-error {{cannot convert value of type 'UInt8' to type 'Int' in coercion}}
|
|
|
|
_ = FALSE // expected-error {{use of unresolved identifier 'FALSE'}}
|
|
_ = DYLD_BOOL.FALSE
|