Skip to content

Commit e2c6fe8

Browse files
committed
Explicitly pass -requirement-machine-inferred-signatures=on in a test where the GSB was wrong
1 parent 1784aee commit e2c6fe8

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

test/Constraints/generic_super_constraint.swift

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,13 @@
1-
// RUN: %target-swift-frontend %s -typecheck -verify
1+
// RUN: %target-typecheck-verify-swift %s -requirement-machine-inferred-signatures=on
22

33
class Base<T> { }
44
class Derived: Base<Int> { }
55

66
func foo<T>(_ x: T) -> Derived where T: Base<Int>, T: Derived {
7-
// expected-warning@-1{{redundant superclass constraint 'T' : 'Base<Int>'}}
8-
// expected-note@-2{{superclass constraint 'T' : 'Base<Int>' implied here}}
97
return x
108
}
119

12-
// FIXME: Should not be an error
13-
// expected-error@+2{{type 'U' cannot be a subclass of both 'Derived' and 'Base<T>'}}
14-
// expected-note@+1{{constraint conflicts with 'U' : 'Base<T>'}}
1510
func bar<T, U>(_ x: U, y: T) -> (Derived, Int) where U: Base<T>, U: Derived {
16-
// FIXME
17-
// expected-error@+1{{cannot convert return expression}}
1811
return (x, y)
1912
}
2013

0 commit comments

Comments
 (0)