mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
A parse-only option is needed for parse performance tracking and the current option also includes semantic analysis.
18 lines
382 B
Swift
18 lines
382 B
Swift
// RUN: %target-typecheck-verify-swift
|
|
|
|
struct A {
|
|
func foo() {}
|
|
}
|
|
|
|
var a : A?
|
|
var b : A ? // expected-error {{consecutive statements on a line}} {{10-10=;}} expected-error {{expected expression}}
|
|
|
|
var c = a? // expected-error {{'?' must be followed by a call, member lookup, or subscript}}
|
|
var d : ()? = a?.foo()
|
|
|
|
var e : (() -> A)?
|
|
var f = e?()
|
|
|
|
struct B<T> {}
|
|
var g = B<A!>()
|