mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
A parse-only option is needed for parse performance tracking and the current option also includes semantic analysis.
17 lines
456 B
Swift
17 lines
456 B
Swift
// RUN: %target-swift-frontend %s -typecheck -verify
|
|
|
|
class Base<T> { }
|
|
class Derived: Base<Int> { }
|
|
|
|
func foo<T>(_ x: T) -> Derived where T: Base<Int>, T: Derived {
|
|
return x
|
|
}
|
|
|
|
// FIXME: Should not be an error
|
|
// expected-error@+1{{cannot be a subclass of both 'Base<T>' and 'Derived'}}
|
|
func bar<T, U>(_ x: U, y: T) -> (Derived, Int) where U: Base<T>, U: Derived {
|
|
// FIXME
|
|
// expected-error@+1{{cannot convert return expression}}
|
|
return (x, y)
|
|
}
|