mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 21:39:07 +00:00
Type fixes
This commit is contained in:
parent
b2d3b52bd5
commit
3e3d3cc7f3
6 changed files with 2 additions and 44 deletions
|
@ -846,16 +846,6 @@ trait Backend<'a> {
|
||||||
self.load_literal_i64(sym, 0);
|
self.load_literal_i64(sym, 0);
|
||||||
}
|
}
|
||||||
Expr::FunctionPointer { .. } => todo_lambda_erasure!(),
|
Expr::FunctionPointer { .. } => todo_lambda_erasure!(),
|
||||||
Expr::Reuse {
|
|
||||||
tag_layout,
|
|
||||||
tag_id,
|
|
||||||
symbol: reused,
|
|
||||||
arguments,
|
|
||||||
..
|
|
||||||
} => {
|
|
||||||
self.load_literal_symbols(arguments);
|
|
||||||
self.tag(sym, arguments, tag_layout, *tag_id, Some(*reused));
|
|
||||||
}
|
|
||||||
Expr::Reset { symbol, .. } => {
|
Expr::Reset { symbol, .. } => {
|
||||||
let layout = *self.layout_map().get(symbol).unwrap();
|
let layout = *self.layout_map().get(symbol).unwrap();
|
||||||
|
|
||||||
|
|
|
@ -1142,14 +1142,6 @@ impl<'a, 'r> WasmBackend<'a, 'r> {
|
||||||
|
|
||||||
Expr::FunctionPointer { .. } => todo_lambda_erasure!(),
|
Expr::FunctionPointer { .. } => todo_lambda_erasure!(),
|
||||||
|
|
||||||
Expr::Reuse {
|
|
||||||
tag_layout,
|
|
||||||
tag_id,
|
|
||||||
arguments,
|
|
||||||
symbol: reused,
|
|
||||||
..
|
|
||||||
} => self.expr_tag(tag_layout, *tag_id, arguments, sym, storage, Some(*reused)),
|
|
||||||
|
|
||||||
Expr::Reset { symbol: arg, .. } => self.expr_reset(*arg, sym, storage),
|
Expr::Reset { symbol: arg, .. } => self.expr_reset(*arg, sym, storage),
|
||||||
|
|
||||||
Expr::ResetRef { symbol: arg, .. } => self.expr_resetref(*arg, sym, storage),
|
Expr::ResetRef { symbol: arg, .. } => self.expr_resetref(*arg, sym, storage),
|
||||||
|
|
|
@ -1044,7 +1044,7 @@ pub fn lowlevel_borrow_signature(arena: &Bump, op: LowLevel) -> &[Ownership] {
|
||||||
PtrCast => arena.alloc_slice_copy(&[owned]),
|
PtrCast => arena.alloc_slice_copy(&[owned]),
|
||||||
Alloca => arena.alloc_slice_copy(&[owned]),
|
Alloca => arena.alloc_slice_copy(&[owned]),
|
||||||
|
|
||||||
PtrClearTagId | PtrCast | RefCountIncRcPtr | RefCountDecRcPtr | RefCountIncDataPtr
|
PtrClearTagId | RefCountIncRcPtr | RefCountDecRcPtr | RefCountIncDataPtr
|
||||||
| RefCountDecDataPtr | RefCountIsUnique => {
|
| RefCountDecDataPtr | RefCountIsUnique => {
|
||||||
unreachable!("Only inserted *after* borrow checking: {:?}", op);
|
unreachable!("Only inserted *after* borrow checking: {:?}", op);
|
||||||
}
|
}
|
||||||
|
|
|
@ -495,21 +495,6 @@ impl<'a, 'r> Ctx<'a, 'r> {
|
||||||
}
|
}
|
||||||
Some(Layout::OPAQUE_PTR)
|
Some(Layout::OPAQUE_PTR)
|
||||||
}
|
}
|
||||||
&Expr::Reuse {
|
|
||||||
symbol,
|
|
||||||
update_tag_id: _,
|
|
||||||
update_mode: _,
|
|
||||||
tag_layout,
|
|
||||||
tag_id: _,
|
|
||||||
arguments: _,
|
|
||||||
} => {
|
|
||||||
let union = self
|
|
||||||
.interner
|
|
||||||
.insert_direct_no_semantic(LayoutRepr::Union(tag_layout));
|
|
||||||
self.check_sym_layout(symbol, union, UseKind::TagReuse);
|
|
||||||
// TODO also check update arguments
|
|
||||||
Some(union)
|
|
||||||
}
|
|
||||||
&Expr::Reset {
|
&Expr::Reset {
|
||||||
symbol,
|
symbol,
|
||||||
update_mode: _,
|
update_mode: _,
|
||||||
|
|
|
@ -1601,7 +1601,7 @@ fn low_level_no_rc(lowlevel: &LowLevel) -> RC {
|
||||||
PtrCast => RC::NoRc,
|
PtrCast => RC::NoRc,
|
||||||
Alloca => RC::NoRc,
|
Alloca => RC::NoRc,
|
||||||
|
|
||||||
PtrClearTagId | PtrCast | RefCountIncRcPtr | RefCountDecRcPtr | RefCountIncDataPtr
|
PtrClearTagId | RefCountIncRcPtr | RefCountDecRcPtr | RefCountIncDataPtr
|
||||||
| RefCountDecDataPtr | RefCountIsUnique => {
|
| RefCountDecDataPtr | RefCountIsUnique => {
|
||||||
unreachable!("Only inserted *after* borrow checking: {:?}", lowlevel);
|
unreachable!("Only inserted *after* borrow checking: {:?}", lowlevel);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1900,15 +1900,6 @@ pub enum Expr<'a> {
|
||||||
lambda_name: LambdaName<'a>,
|
lambda_name: LambdaName<'a>,
|
||||||
},
|
},
|
||||||
|
|
||||||
Reuse {
|
|
||||||
symbol: Symbol,
|
|
||||||
update_tag_id: bool,
|
|
||||||
update_mode: UpdateModeId,
|
|
||||||
// normal Tag fields
|
|
||||||
tag_layout: UnionLayout<'a>,
|
|
||||||
tag_id: TagIdIntType,
|
|
||||||
arguments: &'a [Symbol],
|
|
||||||
},
|
|
||||||
Reset {
|
Reset {
|
||||||
symbol: Symbol,
|
symbol: Symbol,
|
||||||
update_mode: UpdateModeId,
|
update_mode: UpdateModeId,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue