We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f9f3f13 commit b31fa29Copy full SHA for b31fa29
tests/ui/coercion/coerce-many-with-ty-var.rs
@@ -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