mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
237 lines
2.3 KiB
Swift
237 lines
2.3 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
|
|
}
|
|
struct d{
|
|
}
|
|
println("
|
|
}
|
|
let t: e {
|
|
let t:a{
|
|
}
|
|
var b {
|
|
var b {
|
|
func i{
|
|
retur
|
|
let a"
|
|
{
|
|
}
|
|
{
|
|
}
|
|
class B<T : A {
|
|
}
|
|
struct c<T
|
|
}
|
|
{
|
|
enum b{
|
|
let t: {
|
|
}
|
|
let a {
|
|
}
|
|
}
|
|
a
|
|
enum A {
|
|
let t: A {
|
|
var b : =<T where k=
|
|
case c<
|
|
class A {
|
|
}
|
|
struct D<T
|
|
var b {
|
|
typealias
|
|
class
|
|
retur
|
|
protocol d{
|
|
return nil
|
|
let a {
|
|
struct D<
|
|
func a"
|
|
protocol d<T>? {
|
|
}
|
|
return nil
|
|
typealias
|
|
{
|
|
{
|
|
var d where h: T
|
|
struct d<T
|
|
protocol d<T where h: da
|
|
}
|
|
class A
|
|
retur
|
|
{
|
|
}
|
|
{
|
|
case c<T: A {
|
|
{
|
|
class A {
|
|
retur
|
|
class A {var d<
|
|
}
|
|
struct d<T where T
|
|
typealias
|
|
}
|
|
class B<U : =a {
|
|
var b : T: =
|
|
let a
|
|
let t: B
|
|
{
|
|
}
|
|
var b {
|
|
}
|
|
var b {
|
|
println("\(f=<T: U.R
|
|
typealias e:a{
|
|
{
|
|
struct D {
|
|
}
|
|
func a{
|
|
}var f: Int -> S<U : U.b
|
|
}
|
|
class A {
|
|
}
|
|
{
|
|
}
|
|
{
|
|
let a {
|
|
deinit {
|
|
let t:A}
|
|
: B<T where T where B
|
|
struct d{
|
|
}
|
|
func <T: {
|
|
{
|
|
let a {
|
|
{
|
|
a
|
|
let g {
|
|
deinit {
|
|
typealias
|
|
{
|
|
protocol d<T : B
|
|
class A {
|
|
struct c<T:A.b{
|
|
{
|
|
let t: U.R
|
|
case c<T) {
|
|
let g {
|
|
class
|
|
a{
|
|
let a {
|
|
}
|
|
{f<T where T) -> S<T: e {class a {var f: A.R
|
|
func f<T: A {
|
|
protocol d{
|
|
}
|
|
func <U : =b( )
|
|
}
|
|
{
|
|
var b {var d = b
|
|
{
|
|
println(
|
|
}
|
|
}
|
|
let a where B
|
|
deinit {
|
|
a"
|
|
struct D {
|
|
let a where T) {
|
|
let a where T where B<T
|
|
var b {
|
|
let t:d{
|
|
var d<T
|
|
var d where T where k=
|
|
var b {var b {
|
|
}
|
|
println(t:A
|
|
class
|
|
let a
|
|
for c {
|
|
class A
|
|
struct A}
|
|
{let t: T: e {
|
|
{class B
|
|
var b {
|
|
class B<d = b
|
|
{
|
|
{
|
|
func <T : A {
|
|
func f=a where h: T: A {
|
|
func <T:
|
|
struct D<T:d{
|
|
{struct A<T: Int -> S<T>? {
|
|
typealias e
|
|
: {
|
|
}
|
|
var b {
|
|
typealias
|
|
let g {
|
|
let a"\(
|
|
}
|
|
class A {
|
|
}
|
|
println(
|
|
}
|
|
struct D {
|
|
}
|
|
let a{
|
|
}var b : B<T: A {let g {class B<Q<T where T>(
|
|
class A {f<U : B<T where h: P{
|
|
struct c<T : P> {
|
|
enum b
|
|
case c,
|
|
}
|
|
typealias R
|
|
var d{
|
|
}
|
|
struct d{
|
|
let a
|
|
typealias
|
|
let t: {
|
|
let a"\("
|
|
var d<T: e {
|
|
}
|
|
struct D {
|
|
}
|
|
typealias
|
|
}
|
|
struct D {
|
|
for c {
|
|
struct A}
|
|
{=o("\((f<d where h:a{f
|
|
}
|
|
typealias R
|
|
{
|
|
}
|
|
{
|
|
func a"
|
|
{f=a {
|
|
func i{
|
|
enum A {
|
|
func f<T>>>? {
|
|
return nil
|
|
}
|
|
protocol P {
|
|
{var b {
|
|
protocol B :a{
|
|
let t:
|
|
protocol d<T: da
|
|
func f<T: T: Int -> (f: {class a {
|
|
struct D {
|
|
case c,
|
|
var b : e {
|
|
}
|
|
{
|
|
for c {
|
|
typealias
|
|
a
|
|
typealias
|
|
struct D {let a{
|
|
struct A
|
|
return nil
|
|
typealias R
|