// 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 kj() -> (ts, ts -> ts) -> ts { nm ml nm.p = { } { ts) { ji } } protocol kj { class func p() } class nm: kj{ class func p {} x nm { hg ts(q, () -> ()) } dc ji = po dc qp: m -> m = { cb $w } let e: m = { (c: m, kj: m -> m) -> m on cb kj(c) }(ji, qp) let u: m = { c, kj on cb kj(c) }(ji, qp) class c { func hg((r, c))(rq: (r, y)) { hg(rq) } } protocol rq hg : rq { } class hg { } protocol c { o ts } protocol rq { } protocol hg : rq { } protocol c : rq { } protocol nm { o kj = rq } gf e : nm { o kj = hg } func p (cb: ml) { } func p (cb: v) { } p(e()) func c { } gf c { dc hg: nm } func rq() -> [c] { cb [] } protocol kj { o v func hg(v) } gf rq : kj { func hg(hg: rq.lk) { } } class rq { } protocol hg { o nm o e fe e = rq, nm> } protocol rq { class func c() } class hg: rq { class func c() { } } (hg() s rq).t.c() func sr(ed: ml) -> (() -> q) -> ml { cb { ts on "\(ed): \(ts())" } } gf kj { let rq: [(q, () -> ())] = [] } func() { x hg { hg c } } func rq(hg: m = w) { } let c = rq