Files
swift-mirror/test/expr/cast/precedence.swift
David Farler b7d17b25ba Rename -parse flag to -typecheck
A parse-only option is needed for parse performance tracking and the
current option also includes semantic analysis.
2016-11-28 10:50:55 -08:00

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=)!}}
}