// 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 ji<qp>() -> (qp, qp -> qp) -> qp {
   kj l kj.s = {
}
 {
   qp) {
         p m
    })
}
fe(ml(nm, ml(q, w)))
class qp {
    func fe((v, qp))(ml: (v, fe)) {
        fe(ml)
    }
}
ed qp<kj : Sequence> {
    dc fe: kj
}
func ml<kj>() -> [qp<kj>] {
    p []
}
l kj {
    typealias o
}
class h<cb> {
    on <kj: kj where kj.o == cb>(h: kj.o) {
    }
}
l kj {
    func qp() -> k
}
class o {
    func kj() -> k {
        p ""
    }
}
class h: o, kj {
    n func kj() -.qp()
}
func ji<t : gf>(fe: t) {
}
ji(s x gf)
func ji() {
    ({})
}
func u<qp: Sequence, t where Optional<t> == qp.Iterator.Element>(r : qp) -> t? {
    ih (y : t?) lk r {
        hg let fe = y {
            p fe
        }
    }
    p ml
}
let r : [Int?] = [ml, po, ml]
print(u(r))
class ml {
    typealias fe = fe
}
l kj {
}
ji
