mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
A ? operator is interpreted as this if it's left-bound, so ternary operators now have to be spaced on the left. Swift SVN r8832
16 lines
244 B
Swift
16 lines
244 B
Swift
// RUN: %swift -parse -verify %s
|
|
|
|
struct A {
|
|
func foo() {}
|
|
}
|
|
|
|
var a : A?
|
|
var b : A ? // expected-error {{consecutive statements on a line}} expected-error {{expected expression}}
|
|
|
|
var c = a?
|
|
var d = a?.foo()
|
|
|
|
var e : (() -> A)?
|
|
var f = e?()
|
|
|