mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
13 lines
226 B
Swift
13 lines
226 B
Swift
// RUN: %target-typecheck-verify-swift
|
|
|
|
protocol P {}
|
|
class Helper {}
|
|
|
|
class Base {}
|
|
class Sub<T>: Base {}
|
|
|
|
// The superclass constraint was the culprit.
|
|
func foo<T: Helper & P>(base: Base, arg: T) {
|
|
_ = base as? Sub<T>
|
|
}
|