mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 21:39:07 +00:00
Intern unwrapped capture layout
This commit is contained in:
parent
7045001f64
commit
58a28bb7b8
1 changed files with 4 additions and 4 deletions
|
@ -1290,7 +1290,7 @@ pub enum ClosureRepresentation<'a> {
|
|||
/// We MUST sort these according to their stack size before code gen!
|
||||
AlphabeticOrderStruct(&'a [InLayout<'a>]),
|
||||
/// The closure is one function that captures a single identifier, whose value is unwrapped.
|
||||
UnwrappedCapture(Layout<'a>),
|
||||
UnwrappedCapture(InLayout<'a>),
|
||||
/// The closure dispatches to multiple functions, but none of them capture anything, so this is
|
||||
/// a boolean or integer flag.
|
||||
EnumDispatch(EnumDispatch),
|
||||
|
@ -1471,13 +1471,13 @@ impl<'a> LambdaSet<'a> {
|
|||
I: Interner<'a, Layout<'a>>,
|
||||
F: Fn(Symbol, &[InLayout]) -> bool,
|
||||
{
|
||||
let repr = interner.get(self.representation);
|
||||
|
||||
if self.has_unwrapped_capture_repr() {
|
||||
// Only one function, that captures one identifier.
|
||||
return ClosureRepresentation::UnwrappedCapture(*repr);
|
||||
return ClosureRepresentation::UnwrappedCapture(self.representation);
|
||||
}
|
||||
|
||||
let repr = interner.get(self.representation);
|
||||
|
||||
match repr {
|
||||
Layout::Union(union) => {
|
||||
// here we rely on the fact that a union in a closure would be stored in a one-element record.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue