// This source file is part of the Swift.org open source project // Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/LICENSE.txt for license information // See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // RUN: not %target-swift-frontend %s -typecheck ({}) func f() { ({}) } class a { typealias b = b } class A: A { } class B : C { } typealias C = B func a() { enum b { case c } } protocol A { typealias E } struct B { let h: T let i: T.E } protocol C { typealias F func g(f: B) } struct D : C { typealias F = Int func g(f: B) { } } protocol b { class func e() } struct c { var d: b.Type func e() { d.e() } } func c { init (e: A.B) { c { func b((Any, c))(a: (Any, AnyObject)) { b(a) } } protocol A { } struct B : A { } struct C { } protocol a { class func c() } class b: a { class func c() { } } (b() as a).dynamicType.c() struct A { let a: [(T, () -> ())] = [] } func a() -> (T, T -> T) -> T { var b: ((T, T -> T) -> T)! return b } class A { } struct c { var b: d } func a() -> [c] { return [] } f e) func f() -> (g, g -> g) -> g { d j d.i = { } { g) { h } } protocol f { class func i() } class d: f{ class func i {} func i(c: () -> ()) { } class a { var _ = i() { } } import Foundation class Foo: NSObject { var foo: T init(foo: T) { self.foo = foo super.init() } } func some == S.Iterator.Element>(xs : S) -> T? { for (mx : T?) in xs { if let x = mx { return x } } return nil } let xs : [Int?] = [nil, 4, nil] print(some(xs)) a=1 as a=1