mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 22:09:09 +00:00
closure_env_layout
This commit is contained in:
parent
b54033a2f5
commit
cc98237a0a
6 changed files with 57 additions and 45 deletions
|
@ -143,6 +143,14 @@ impl<'a> LambdaSet<'a> {
|
|||
*self.representation
|
||||
}
|
||||
|
||||
pub fn is_represented(&self) -> Option<Layout<'a>> {
|
||||
if let Layout::Struct(&[]) = self.representation {
|
||||
None
|
||||
} else {
|
||||
Some(*self.representation)
|
||||
}
|
||||
}
|
||||
|
||||
pub fn layout_for_member(&self, function_symbol: Symbol) -> ClosureRepresentation<'a> {
|
||||
debug_assert!(
|
||||
self.set.iter().any(|(s, _)| *s == function_symbol),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue