Files
swift-mirror/test/Parse/optional.swift
John McCall 298577676e Introduce the monadic ? operator.
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
2013-10-02 01:27:45 +00:00

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?()