// 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 b(c) -> (() -> d) { } struct d { } protocol e { typealias h } struct c { var b: d } func a() -> [c] { return [] } func i(c: () -> ()) { } class a { var _ = i() { } } 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 A { func c() -> String } class B { func d() -> String { return "" B) { } } func ^(a: Boolean, Bool) -> Bool { return !(a) } func f(b: T) { } f(true as Boolean) var f = 1 var e: Int -> Int = { return $0 } let d: Int = { c, b in }(f, e) func d == b.Iterator.Element>(c : b) -> e? { for (mx : e?) in c { } } protocol a { } protocol b : a { } protocol c : a { } protocol d { typealias f = a } struct e : d { typealias f = b } func i (n: k) { } func i (n: l) { } i(e(ass func c() } class b: a { class func c() { } } (b() as a).dynamicType.c() class a { } protocol b { typealias d typealias e } struct c : b { typealias d = h typealias e = a, d> } class a { typealias b = b } func a(b: Int = 0) { } let c = a c() enum S { case C(T, () -> ()) } func f() { ({}) } enum S : P { func f() -> T -> T { return { x in x } } } protocol P { func f()(T) -> T } protocol A { typealias B func b(B) } struct X : A { func b(b: X.Type) { } } class A { } protocol a { typealias d typealias e = d typealias f = d } class b : a { } class b { } protocol c { typealias g } struct A { let a: [(T, () -> ())] = [] } struct c { } func a(x: Any, y: Any) -> (((Any, Any) -> Any) -> Any) { return { (m: (Any, Any) -> Any) -> Any in return m(x, y) } } func b(z: (((Any, Any) -> Any) -> Any)) -> Any { return z({ (p: Any, q:Any) -> Any in return p }) } b(a(1, a(2, 3))) func a() -> (T, T -> T) -> T { var b: ((T, T -> T) -> T)! return b } protocol b { class func e() } struct c { var d: b.Type func e() { d.e() } } import Foundation class d: NSObject { var b: c init(b: c) { self.b = b } } func a() { enum b { case c } } protocol a : a { } class A : A { } class B : C { } typealias C = B