mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
46 lines
964 B
Swift
46 lines
964 B
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 p<ed>() -> (ed, ed -> ed) -> ed {
|
|
s n s.v = {
|
|
}
|
|
{
|
|
ed) {
|
|
m }
|
|
}
|
|
l p {
|
|
class func v()
|
|
}
|
|
class s: p{ class func v {}
|
|
l ed {
|
|
typealias q
|
|
}
|
|
class m<p> {
|
|
w <ed: ed k ed.q == p>(n: ed.(((y, y) -> y) -> y)) -> y {
|
|
t u({
|
|
(o: y, s:y) -> y in
|
|
t o
|
|
})
|
|
}
|
|
p(x(a, x(b, cb)))
|
|
class x {
|
|
typealias p = p
|
|
}
|
|
class x<p : p, ed : p k p.s == ed> {
|
|
}
|
|
l p {
|
|
typealias s
|
|
typealias n
|
|
}
|
|
n v<m : p> : p {
|
|
typealias s = m
|
|
typealias n = x<v<m>, s>
|
|
}
|
|
class v {
|
|
func p((y, v))(x: (y, dc: r = { (v: r, p: r -> r) -> r in
|