feat: support var-args lambda function

This commit is contained in:
Shunsuke Shibayama 2023-03-03 16:01:20 +09:00
parent cb00efca54
commit 3d310714f1
13 changed files with 123 additions and 47 deletions

View file

@ -672,6 +672,9 @@ impl Context {
(Structural(l), Structural(r)) => self.structural_supertype_of(l, r),
// TODO: If visibility does not match, it should be reported as a cause of an error
(Structural(l), r) => {
if self.supertype_of(l, r) {
return true;
}
let r_fields = self.fields(r);
for (l_field, l_ty) in self.fields(l) {
if let Some((r_field, r_ty)) = r_fields.get_key_value(&l_field) {