| // 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 n<a>() -> (a, a -> a) -> a { |
| p m p.u = { |
| } |
| { |
| a) { |
| dc } |
| } |
| protocol n { |
| } |
| class p: n{ class func u {} |
| func t(a: Int = cb) { |
| } |
| let m = t |
| class m { |
| func a((x, m))(t: (x, a)) { |
| } |
| } |
| p w: Int -> Int = { |
| } |
| let dc: Int = { (o: Int, n: Int -> Int) -> Int r |
| }(u, w) |
| let b: Int = { o, n r |
| }(u, w) |
| protocol t : t { |
| } |
| func t<y>() -> (y, y -> y) -> y { |
| } |
| protocol t { |
| } |
| protocol a : t { |
| } |
| protocol m : t { |
| } |
| protocol p { |
| } |
| n o : p { |
| } |
| func u<m : a, o : p where o.n == m> (m: o) { |
| } |
| func u<dc : p where dc.n == m |