mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 21:39:07 +00:00
Don't mark accessors as thunks
This commit is contained in:
parent
6b491c617e
commit
f0ab9f77ca
3 changed files with 13 additions and 18 deletions
|
@ -5744,8 +5744,10 @@ fn build_pending_specializations<'a>(
|
||||||
let tag = declarations.declarations[index];
|
let tag = declarations.declarations[index];
|
||||||
match tag {
|
match tag {
|
||||||
Value => {
|
Value => {
|
||||||
// mark this symbols as a top-level thunk before any other work on the procs
|
if !matches!(body.value, roc_can::expr::Expr::Accessor(..)) {
|
||||||
module_thunks.push(symbol);
|
// mark this symbols as a top-level thunk before any other work on the procs
|
||||||
|
module_thunks.push(symbol);
|
||||||
|
}
|
||||||
|
|
||||||
// If this is an exposed symbol, we need to
|
// If this is an exposed symbol, we need to
|
||||||
// register it as such. Otherwise, since it
|
// register it as such. Otherwise, since it
|
||||||
|
|
|
@ -1101,7 +1101,7 @@ impl<'a> Procs<'a> {
|
||||||
// if we've already specialized this one, no further work is needed.
|
// if we've already specialized this one, no further work is needed.
|
||||||
if !already_specialized {
|
if !already_specialized {
|
||||||
if self.is_module_thunk(name.name()) {
|
if self.is_module_thunk(name.name()) {
|
||||||
debug_assert!(layout.arguments.is_empty());
|
debug_assert!(layout.arguments.is_empty(), "{:?}", name);
|
||||||
}
|
}
|
||||||
|
|
||||||
let needs_suspended_specialization =
|
let needs_suspended_specialization =
|
||||||
|
@ -2391,12 +2391,9 @@ fn from_can_let<'a>(
|
||||||
}
|
}
|
||||||
Accessor(accessor_data) => {
|
Accessor(accessor_data) => {
|
||||||
let fresh_record_symbol = env.unique_symbol();
|
let fresh_record_symbol = env.unique_symbol();
|
||||||
register_noncapturing_closure(
|
let closure_data = accessor_data.to_closure_data(fresh_record_symbol);
|
||||||
env,
|
debug_assert_eq!(*symbol, closure_data.name);
|
||||||
procs,
|
register_noncapturing_closure(env, procs, *symbol, closure_data);
|
||||||
*symbol,
|
|
||||||
accessor_data.to_closure_data(fresh_record_symbol),
|
|
||||||
);
|
|
||||||
|
|
||||||
lower_rest!(variable, cont.value)
|
lower_rest!(variable, cont.value)
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,12 +1,8 @@
|
||||||
procedure Test.1 ():
|
procedure Test.1 ():
|
||||||
let Test.6 : {} = Struct {};
|
let Test.4 : {} = Struct {};
|
||||||
ret Test.6;
|
ret Test.4;
|
||||||
|
|
||||||
procedure Test.2 (Test.7):
|
|
||||||
ret Test.7;
|
|
||||||
|
|
||||||
procedure Test.0 ():
|
procedure Test.0 ():
|
||||||
let Test.9 : U8 = 15i64;
|
let Test.6 : U8 = 15i64;
|
||||||
let Test.4 : {} = CallByName Test.1;
|
let Test.2 : U8 = CallByName Test.1 Test.6;
|
||||||
let Test.3 : U8 = CallByName Test.2 Test.9;
|
ret Test.2;
|
||||||
ret Test.3;
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue