| // 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 f { |
| k g d { |
| k d |
| k k |
| } |
| j j<l : d> : d { |
| k , d> |
| } |
| class f: f { |
| } |
| class B : l { |
| = p |
| } |
| f m : m { |
| j f = o |
| } |
| func i<o : o, m : m n m.f == o> (l: m) { |
| } |
| k: m |
| } |
| func p<m>() -> [l<m>] { |
| return [] |
| } |
| f |
| m) |
| func f<o>() -> (o, o -> o) -> o { |
| m o m.i = { |
| } |
| { |
| o) { |
| p } |
| } |
| protocol f { |
| class func i() |
| } |
| class m: f{ class func i {} |
| protocol p { |
| class func l() |
| } |
| class o: p { |
| class func l() { } |
| class c { |
| func b((Any, c))(a: (Any, AnyObject)) { |
| b(a) |
| } |
| } |
| protocol A { |
| typealias B |
| } |
| class C<D> { |
| init <A: A where A.B == D>(e: A.B) { |
| } |
| } |
| o |
| } |
| class f<p : k, p : k where p.n == p> : n { |
| } |
| class f<p, p> { |
| } |
| protocol k { |
| typealias n |
| } |
| o: i where k.j == f> {l func k() { } |
| } |
| (f() as n).m.k() |
| func k<o { |
| enum k { |
| func o |
| var _ = o |
| 1, g(f, j))) |
| m k { |
| class h k() |
| } |
| struct i { |
| i d: k.l h k() { |
| n k |
| } |
| class g { |
| typealias k = k |
| } |
| } |
| e |
| protocol h : e { func e |
| func r(d: t, k: t) -> (((t,} |
| struct e<j> : g { |
| func e( |
| h s: n -> n = { |
| return $u |
| } |
| l o: n = { (d: n, o: n -> n) -> n q |
| return o(d) |
| } |
| ) |
| var d = b |
| =b as c=b |
| func q(v: h) -> <r>(() -> r) -> h { |
| n { u o "\(v): \(u())" } |
| } |
| struct e<r> { |
| j p: , () -> ())] = [] |
| } |
| protocol p { |
| } |
| protocol m : p { |
| } |
| protocol v : p { |
| } |
| protocol m { |
| v = m |
| } |
| func s<s : m, v : m u v.v == s> (m: v)s k { |
| typealias h = h |