// 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 protocol A { typealias B func b(B) } struct X : A { func b(b: X.Type) { } } func a() -> (T, T -> T) -> T { var b: ((T, T -> T) -> T)! return b } func f(b: T) { } f(true as Boolean) protocol a { class func c() } class b: a { class funcol c : a { } protocol d { typealias f = a } struct e : d { typealias f = b } func i (n: k) { } func i (n: l) { } i(e()) class A { } protocol A { func c() -> String } class B { func d() -> String { return "" } } class C: B, A { override func d() -> String { return "" } func c() -> String { return "" } } func e(t: T) { t.c() } struct c { var b: d } func a() -> [c] { return [] } func d == b.Iterator.Element>(c : b) -> e? { for (mx : e?) in c { } } protocol b { class fol C { typealias F func g (() -> d) { } class a { } protocol b { typealias d typealias e } struct c : b { typealias d = h typealias e = a, d> } import Foundation class d: NSObject }