mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 13:29:12 +00:00
Determine whether lambda set is represented as an arg
This commit is contained in:
parent
fc4979e2ce
commit
62dde549e6
1 changed files with 10 additions and 6 deletions
|
@ -840,13 +840,17 @@ impl<'a> LambdaSet<'a> {
|
|||
}
|
||||
|
||||
pub fn is_represented(&self) -> Option<Layout<'a>> {
|
||||
match self.representation {
|
||||
Layout::Struct {
|
||||
field_layouts: &[], ..
|
||||
if self.has_unwrapped_capture_repr() {
|
||||
Some(*self.representation)
|
||||
} else if self.has_multi_dispatch_repr() {
|
||||
None
|
||||
} else {
|
||||
match self.representation {
|
||||
Layout::Struct {
|
||||
field_layouts: &[], ..
|
||||
} => None,
|
||||
repr => Some(*repr),
|
||||
}
|
||||
| Layout::Builtin(Builtin::Bool)
|
||||
| Layout::Builtin(Builtin::Int(..)) => None,
|
||||
repr => Some(*repr),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue