Reuse symbol when opaque type wraps a known symbol

Opaques decay immediately into their argument during codegen, so we need
to handle something that's effectively variable aliasing correctly.

This bug popped up while migrating all current private tags to opaques.
This commit is contained in:
Ayaz Hafiz 2022-04-23 14:37:52 -04:00
parent b417cc6c18
commit 5d1dd81e93
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
4 changed files with 70 additions and 9 deletions

View file

@ -1330,6 +1330,23 @@ fn specialize_ability_call() {
)
}
#[mono_test]
fn opaque_assign_to_symbol() {
indoc!(
r#"
app "test" provides [ out ] to "./platform"
Variable := U8
fromUtf8 : U8 -> Result Variable [ InvalidVariableUtf8 ]
fromUtf8 = \char ->
Ok ($Variable char)
out = fromUtf8 98
"#
)
}
// #[ignore]
// #[mono_test]
// fn static_str_closure() {