type_alias_enum_variants: add regression test for #61801.
This commit is contained in:
parent
d3024138f8
commit
065151f8b2
1 changed files with 30 additions and 0 deletions
|
|
@ -0,0 +1,30 @@
|
|||
// In this regression test we check that a path pattern referring to a unit variant
|
||||
// through a type alias is successful in inferring the generic argument.
|
||||
|
||||
// compile-pass
|
||||
|
||||
#![feature(type_alias_enum_variants)]
|
||||
|
||||
enum Opt<T> {
|
||||
N,
|
||||
S(T),
|
||||
}
|
||||
|
||||
type OptAlias<T> = Opt<T>;
|
||||
|
||||
fn f1(x: OptAlias<u8>) {
|
||||
match x {
|
||||
OptAlias::N // We previously failed to infer `T` to `u8`.
|
||||
=> (),
|
||||
_ => (),
|
||||
}
|
||||
|
||||
match x {
|
||||
<
|
||||
OptAlias<_> // And we failed to infer this type also.
|
||||
>::N => (),
|
||||
_ => (),
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
Loading…
Add table
Add a link
Reference in a new issue