We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d302413 commit 065151fCopy full SHA for 065151f
src/test/ui/type-alias-enum-variants/issue-61801-path-pattern-can-infer.rs
@@ -0,0 +1,30 @@
1
+// In this regression test we check that a path pattern referring to a unit variant
2
+// through a type alias is successful in inferring the generic argument.
3
+
4
+// compile-pass
5
6
+#![feature(type_alias_enum_variants)]
7
8
+enum Opt<T> {
9
+ N,
10
+ S(T),
11
+}
12
13
+type OptAlias<T> = Opt<T>;
14
15
+fn f1(x: OptAlias<u8>) {
16
+ match x {
17
+ OptAlias::N // We previously failed to infer `T` to `u8`.
18
+ => (),
19
+ _ => (),
20
+ }
21
22
23
+ <
24
+ OptAlias<_> // And we failed to infer this type also.
25
+ >::N => (),
26
27
28
29
30
+fn main() {}
0 commit comments