Skip to content

Commit b31fa29

Browse files
committed
add ui test
1 parent f9f3f13 commit b31fa29

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
//@ run-pass
2+
// Check that least upper bound coercions don't resolve type variable merely based on the first
3+
// coercion. Check issue #136420.
4+
5+
fn foo() {}
6+
fn bar() {}
7+
8+
fn infer<T>(_: T) {}
9+
10+
fn infer_array_element<T>(_: [T; 2]) {}
11+
12+
fn main() {
13+
infer(if false {
14+
foo
15+
} else {
16+
bar
17+
});
18+
19+
infer(match false {
20+
true => foo,
21+
false => bar,
22+
});
23+
24+
infer_array_element([foo, bar]);
25+
}

0 commit comments

Comments
 (0)