Skip to content

Commit

Permalink
type_alias_enum_variants: add regression test for #61801.
Browse files Browse the repository at this point in the history
  • Loading branch information
Centril committed Jun 14, 2019
1 parent d302413 commit 065151f
Showing 1 changed file with 30 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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() {}

0 comments on commit 065151f

Please sign in to comment.