Skip to content

Commit 6260b45

Browse files
committed
Add a regression test for SR-5252
1 parent d1c87f3 commit 6260b45

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test/Constraints/sr5252.swift

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// RUN: %target-typecheck-verify-swift
2+
3+
protocol P {}
4+
class Helper {}
5+
6+
class Base {}
7+
class Sub<T>: Base {}
8+
9+
// The superclass constraint was the culprit.
10+
func foo<T: Helper & P>(base: Base, arg: T) {
11+
_ = base as? Sub<T>
12+
}

0 commit comments

Comments
 (0)