Files
swift-mirror/test/Constraints/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

22 lines
356 B
Swift

// RUN: %swift -parse -verify %s
class A {
func [objc] do_a() {}
func [objc] do_b(x : Int) {}
func [objc] do_b(x : Float) {}
func [objc] do_c(x : Int) {}
func [objc] do_c(y : Int) {}
}
func foo(a : DynamicLookup) {
a.do_a?()
a.do_b?(1)
a.do_b?(5.0)
a.do_c?(1) // expected-error {{expression does not type-check}}
a.do_c?(x : 1)
}