Skip to content

Commit

Permalink
Add AnyArityFunType to subtyping and vars elimination
Browse files Browse the repository at this point in the history
Summary: Somehow missed this when adding support for `AnyArityFunType`.

Reviewed By: ilya-klyuchnikov, ruippeixotog

Differential Revision: D60777722

fbshipit-source-id: f22af0791038124e283d1f6a91c3fed33d7eabd4
  • Loading branch information
VLanvin authored and facebook-github-bot committed Aug 6, 2024
1 parent f6290ef commit e60470c
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -159,6 +159,8 @@ class Subtype(pipelineContext: PipelineContext) {
subTypePol(resTy1, resTy2, seen)
case (AnyArityFunType(resTy1), FunType(_, _, resTy2)) =>
subTypePol(resTy1, resTy2, seen)
case (AnyArityFunType(resTy1), AnyArityFunType(resTy2)) =>
subTypePol(resTy1, resTy2, seen)
case (TupleType(tys1), TupleType(tys2)) if tys1.size == tys2.size =>
tys1.lazyZip(tys2).forall(subTypePol(_, _, seen))
case (NilType, ListType(_)) =>
Original file line number Diff line number Diff line change
@@ -28,6 +28,8 @@ object ElimTypeVars {
case FunType(forall, args, resType) =>
val args1 = args.map(elimTypeVars(_, switchMode(mode), vars))
FunType(forall, args1, elim(resType))
case AnyArityFunType(resType) =>
AnyArityFunType(elim(resType))
case TupleType(params) =>
TupleType(params.map(elim))
case ListType(elemT) =>

0 comments on commit e60470c

Please sign in to comment.