mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
10 lines
159 B
Swift
10 lines
159 B
Swift
// RUN: not %target-swift-frontend %s -typecheck
|
|
|
|
class A : A { }
|
|
|
|
func doIt<T>(obj: AnyObject) -> T? {
|
|
return obj as? T
|
|
}
|
|
|
|
let result: A? = doIt(A()) as A?
|