fix: transpiler bug

This commit is contained in:
Shunsuke Shibayama 2024-02-18 17:08:00 +09:00
parent 5fe79c1d41
commit 918f146d08
2 changed files with 44 additions and 11 deletions

View file

@ -560,7 +560,9 @@ impl Context {
(ty @ (Type | ClassType | TraitType), Poly { name, params })
if &name[..] == "Array" || &name[..] == "UnsizedArray" || &name[..] == "Set" =>
{
let elem_t = self.convert_tp_into_type(params[0].clone()).unwrap();
let Ok(elem_t) = self.convert_tp_into_type(params[0].clone()) else {
return false;
};
self.supertype_of(ty, &elem_t)
}
(ty @ (Type | ClassType | TraitType), Poly { name, params })