Skip to content

Commit

Permalink
test: Add another test for variant shadowing
Browse files Browse the repository at this point in the history
  • Loading branch information
Marwes committed Jun 26, 2018
1 parent 182c396 commit 4d0e779
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions check/tests/pass.rs
Original file line number Diff line number Diff line change
Expand Up @@ -899,3 +899,23 @@ Test "" 1

assert!(result.is_ok(), "{}", result.unwrap_err());
}

#[test]
fn allow_more_generalize_variant_to_be_used_despite_specialized_imported_first() {
let _ = env_logger::try_init();

let text = r#"
let record =
type Test a = | Test a
type TestInt = Test Int
{ Test, TestInt }
let { TestInt } = record
let { Test } = record
Test ""
"#;
let result = support::typecheck(text);

assert!(result.is_ok(), "{}", result.unwrap_err());
}

0 comments on commit 4d0e779

Please sign in to comment.