Specialize polymorphic values before binding to pattern

Closes #2811
This commit is contained in:
Ayaz Hafiz 2022-04-07 14:03:29 -04:00
parent 37729c08cc
commit a12e40a310
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
4 changed files with 50 additions and 7 deletions

View file

@ -1587,3 +1587,19 @@ fn str_to_dec() {
RocDec
);
}
#[test]
#[cfg(any(feature = "gen-llvm"))]
fn issue_2811() {
assert_evals_to!(
indoc!(
r#"
x = Command { tool: "bash" }
Command c = x
c.tool
"#
),
RocStr::from("bash"),
RocStr
);
}