Skip to content

Commit bbb74be

Browse files
authored
fix(compiler): recursively check type equality for seq types (#138)
1 parent 679c2e8 commit bbb74be

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

core/compiler/src/compile.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -753,7 +753,17 @@ impl<'a> VarIdTyPass<'a> {
753753
}
754754

755755
fn assert_eq_ty(&mut self, span: cfgrammar::Span, found: &Ty, expected: &Ty) {
756-
if *found != *expected && !(*found == Ty::Any || *expected == Ty::Any) {
756+
if *found == Ty::Any || *expected == Ty::Any {
757+
return;
758+
}
759+
760+
if let Ty::Seq(found) = found
761+
&& let Ty::Seq(expected) = expected
762+
{
763+
return self.assert_eq_ty(span, found, expected);
764+
}
765+
766+
if *found != *expected {
757767
self.errors.push(StaticError {
758768
span: self.span(span),
759769
kind: StaticErrorKind::IncorrectTy {

0 commit comments

Comments
 (0)