mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 21:39:07 +00:00
Newtype destructures test for record that decay into their only arg
This commit is contained in:
parent
929a00e73d
commit
f3722659fc
2 changed files with 26 additions and 2 deletions
|
@ -985,9 +985,13 @@ fn needs_tests(pattern: &Pattern) -> bool {
|
|||
// read the appropriate argument in the struct when constructing the decision tree.
|
||||
arguments.len() != 1
|
||||
}
|
||||
RecordDestructure(arguments, _) => {
|
||||
// Same logic as for newtype destructures - records with one argument decay into their
|
||||
// argument.
|
||||
arguments.len() != 1
|
||||
}
|
||||
|
||||
RecordDestructure(_, _)
|
||||
| AppliedTag { .. }
|
||||
AppliedTag { .. }
|
||||
| OpaqueUnwrap { .. }
|
||||
| BitLiteral { .. }
|
||||
| EnumLiteral { .. }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue