mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
116 lines
1.7 KiB
Swift
116 lines
1.7 KiB
Swift
// 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) -> ts {
|
|
nm ml nm.p = {
|
|
}
|
|
{
|
|
ts) {
|
|
ji }
|
|
}
|
|
protocol kj {
|
|
class func p()
|
|
}
|
|
class nm: kj{ class func p {}
|
|
x nm<q> {
|
|
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<ji : c, p : c ih ji.ts == p> : rq {
|
|
}
|
|
class hg<ji, p> {
|
|
}
|
|
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<ml : hg, ml : nm ih ml.kj == ml> (cb: ml) {
|
|
}
|
|
func p<v : nm ih v.kj == c> (cb: v) {
|
|
}
|
|
p(e())
|
|
func c<nm {
|
|
x c {
|
|
func e
|
|
dc _ = e
|
|
}
|
|
}
|
|
protocol kj {
|
|
}
|
|
gf v : kj {
|
|
}
|
|
gf ts<hg, p: kj ih hg.ts == p> {
|
|
}
|
|
gf c<nm : ut> {
|
|
dc hg: nm
|
|
}
|
|
func rq<nm>() -> [c<nm>] {
|
|
cb []
|
|
}
|
|
protocol kj {
|
|
o v
|
|
func hg(v)
|
|
}
|
|
gf rq<Y> : kj {
|
|
func hg(hg: rq.lk) {
|
|
}
|
|
}
|
|
class rq<kj : hg, ts : hg ih kj.nm == ts> {
|
|
}
|
|
protocol hg {
|
|
o nm
|
|
o e
|
|
fe e = rq<c<ji>, nm>
|
|
}
|
|
protocol rq {
|
|
class func c()
|
|
}
|
|
class hg: rq {
|
|
class func c() { }
|
|
}
|
|
(hg() s rq).t.c()
|
|
func sr(ed: ml) -> <q>(() -> q) -> ml {
|
|
cb { ts on "\(ed): \(ts())" }
|
|
}
|
|
gf kj<q> {
|
|
let rq: [(q, () -> ())] = []
|
|
}
|
|
func() {
|
|
x hg {
|
|
hg c
|
|
}
|
|
}
|
|
func rq(hg: m = w) {
|
|
}
|
|
let c = rq
|