mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 06:44:46 +00:00
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:
parent
b417cc6c18
commit
5d1dd81e93
4 changed files with 70 additions and 9 deletions
|
@ -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() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue