correct sort/keysort refusing []
This commit is contained in:
@@ -32,7 +32,7 @@ impl MachineState {
|
|||||||
|
|
||||||
match self.detect_cycles(usize::max_value(), sorted.clone()) {
|
match self.detect_cycles(usize::max_value(), sorted.clone()) {
|
||||||
CycleSearchResult::NotList if !sorted.is_ref() =>
|
CycleSearchResult::NotList if !sorted.is_ref() =>
|
||||||
Err(self.error_form(self.type_error(ValidType::List, sorted))),
|
Err(self.error_form(self.type_error(ValidType::List, sorted))),
|
||||||
_ => Ok(())
|
_ => Ok(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1724,8 +1724,10 @@ impl MachineState {
|
|||||||
},
|
},
|
||||||
Addr::HeapCell(_) | Addr::StackCell(..) =>
|
Addr::HeapCell(_) | Addr::StackCell(..) =>
|
||||||
Err(self.error_form(self.instantiation_error())),
|
Err(self.error_form(self.instantiation_error())),
|
||||||
addr =>
|
Addr::Con(Constant::EmptyList) =>
|
||||||
Err(self.error_form(self.type_error(ValidType::List, addr)))
|
Ok(vec![]),
|
||||||
|
_ =>
|
||||||
|
Err(self.error_form(self.type_error(ValidType::List, a1)))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1781,7 +1783,10 @@ impl MachineState {
|
|||||||
},
|
},
|
||||||
HeapCellValue::Addr(Addr::Con(Constant::EmptyList)) =>
|
HeapCellValue::Addr(Addr::Con(Constant::EmptyList)) =>
|
||||||
return CycleSearchResult::ProperList(steps),
|
return CycleSearchResult::ProperList(steps),
|
||||||
_ => return CycleSearchResult::PartialList(steps, hare)
|
HeapCellValue::Addr(Addr::HeapCell(_)) | HeapCellValue::Addr(Addr::StackCell(..)) =>
|
||||||
|
return CycleSearchResult::PartialList(steps, hare),
|
||||||
|
_ =>
|
||||||
|
return CycleSearchResult::NotList
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user