Skip to content

Commit 065151f

Browse files
committed
type_alias_enum_variants: add regression test for #61801.
1 parent d302413 commit 065151f

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -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+
match x {
23+
<
24+
OptAlias<_> // And we failed to infer this type also.
25+
>::N => (),
26+
_ => (),
27+
}
28+
}
29+
30+
fn main() {}

0 commit comments

Comments
 (0)