Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
jcp19 committed Oct 28, 2023
1 parent 80450ec commit 73ba895
Showing 1 changed file with 6 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -205,11 +205,11 @@ trait GhostExprTyping extends BaseTyping { this: TypeInfoImpl =>
case t => error(op, s"expected a sequence, multiset or option type, but got $t")
}
case PMapKeys(exp) => underlyingType(exprType(exp)) match {
case Single(_: MathMapT) | Single(_: MapT) => isExpr(exp).out
case Single(_: MathMapT | _: MapT) => isExpr(exp).out
case t => error(expr, s"expected a map, but got $t")
}
case PMapValues(exp) => underlyingType(exprType(exp)) match {
case Single(_: MathMapT) | Single(_: MapT) => isExpr(exp).out
case Single(_: MathMapT | _: MapT) => isExpr(exp).out
case t => error(expr, s"expected a map, but got $t")
}
}
Expand Down Expand Up @@ -315,19 +315,13 @@ trait GhostExprTyping extends BaseTyping { this: TypeInfoImpl =>
case t => violation(s"expected a sequence, set, multiset or option type, but got $t")
}
case PMapKeys(exp) => underlyingType(exprType(exp)) match {
case Single(t) => t match {
case t: MathMapT => SetT(t.key)
case t: MapT => SetT(t.key)
case t => violation(s"expected a map, but got $t")
}
case Single(t: MathMapT) => SetT(t.key)
case Single(t: MapT) => SetT(t.key)
case t => violation(s"expected a map, but got $t")
}
case PMapValues(exp) => underlyingType(exprType(exp)) match {
case Single(t) => t match {
case t: MathMapT => SetT(t.elem)
case t: MapT => SetT(t.elem)
case t => violation(s"expected a map, but got $t")
}
case Single(t: MathMapT) => SetT(t.elem)
case Single(t: MapT) => SetT(t.elem)
case t => violation(s"expected a map, but got $t")
}
}
Expand Down

0 comments on commit 73ba895

Please sign in to comment.