forked from swiftlang/swift
- Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexistential-class-bound7.swift
28 lines (19 loc) · 824 Bytes
/
existential-class-bound7.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// RUN: %target-swift-emit-ir -parse-as-library -module-name main -verify %s -enable-experimental-feature Embedded -wmo
// REQUIRES: swift_in_compiler
// REQUIRES: optimized_stdlib
// REQUIRES: swift_feature_Embedded
publicprotocolP:AnyObject{
func foo<T>(t:T)
}
finalpublicclassClass:P{
publicfunc foo<T>(t:T){} // expected-error {{a protocol type cannot contain a generic method 'foo(t:)' in embedded Swift}}
}
publicfunc testClass()->P{
returnClass() // expected-note {{protocol type value created here}}
}
finalpublicclassGenClass<X>:P{
publicfunc foo<T>(t:T){} // expected-error {{a protocol type cannot contain a generic method 'foo(t:)' in embedded Swift}}
}
publicfunc testGenClass()->P{
returnGenClass<Int>() // expected-note {{protocol type value created here}}
}