add one more test
This commit is contained in:
parent
5e5a9dd25f
commit
e15e725bfe
|
@ -1389,7 +1389,7 @@ impl<'a> CodeGenerator<'a> {
|
|||
Pattern::Discard { .. } => None,
|
||||
a @ Pattern::List { elements, tail, .. } => {
|
||||
let item_name = format!("__list_item_id_{}", self.id_gen.next());
|
||||
let new_tail_name = "__list_tail".to_string();
|
||||
let new_tail_name = "__tail".to_string();
|
||||
|
||||
if elements.is_empty() {
|
||||
pattern_vec.push(Air::ListClauseGuard {
|
||||
|
@ -1477,9 +1477,7 @@ impl<'a> CodeGenerator<'a> {
|
|||
inverse: true,
|
||||
});
|
||||
|
||||
|
||||
pattern_vec.push(Air::Void { scope: scope.clone() });
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,3 +5,13 @@ test foo() {
|
|||
_ -> False
|
||||
}
|
||||
}
|
||||
|
||||
test sort_by_1() {
|
||||
let xs = [[4, 3], [2, 3]]
|
||||
let g = when xs is {
|
||||
[[x, xs2], [y, ys2]] -> True
|
||||
_ -> False
|
||||
}
|
||||
|
||||
g == True
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue