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.
9 lines
365 B
Swift
9 lines
365 B
Swift
// RUN: %target-typecheck-verify-swift
|
|
|
|
let x: Bool = 3/4 as Float > 1/2 as Float
|
|
|
|
func testInIf(a: Any) {
|
|
if a as? Float {} // expected-error {{cannot be used as a boolean}} {{6-6=((}} {{17-17=) != nil)}}
|
|
let _: Float = a as? Float // expected-error {{value of optional type 'Float?' not unwrapped; did you mean to use '!' or '?'?}} {{18-18=(}} {{29-29=)!}}
|
|
}
|