mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-03 19:58:18 +00:00
Invalidate layout-cached variables correctly after merging
This commit is contained in:
parent
7a7a4fa680
commit
261cd75a71
2 changed files with 16 additions and 1 deletions
|
@ -5671,7 +5671,7 @@ fn convert_tag_union<'a>(
|
|||
) {
|
||||
Layout::Union(ul) => ul,
|
||||
other => internal_error!(
|
||||
"unexpected layout {:?} for {:?}",
|
||||
"unexpected layout {:?} for {:?} ({:?})",
|
||||
other,
|
||||
roc_types::subs::SubsFmtContent(
|
||||
env.subs.get_content_without_compacting(variant_var),
|
||||
|
@ -5680,6 +5680,14 @@ fn convert_tag_union<'a>(
|
|||
),
|
||||
};
|
||||
|
||||
dbg!((
|
||||
&union_layout,
|
||||
roc_types::subs::SubsFmtContent(
|
||||
env.subs.get_content_without_compacting(variant_var),
|
||||
env.subs
|
||||
)
|
||||
));
|
||||
|
||||
use WrappedVariant::*;
|
||||
let (tag, union_layout) = match variant {
|
||||
Recursive { sorted_tag_layouts } => {
|
||||
|
|
|
@ -1982,6 +1982,13 @@ macro_rules! cached_or_impl {
|
|||
|
||||
if criteria.is_cacheable() {
|
||||
// The computed layout is cacheable; insert it.
|
||||
dbg!((
|
||||
$var,
|
||||
roc_types::subs::SubsFmtContent(
|
||||
$self.subs.get_content_without_compacting($var),
|
||||
$self.subs
|
||||
)
|
||||
));
|
||||
$self
|
||||
.cache
|
||||
.$insert($self.subs, $var, result, criteria.cache_metadata());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue