Skip to content

Commit

Permalink
Wrap tester args in list instead of grabbing head of function call. A…
Browse files Browse the repository at this point in the history
…dd test to demonstrate difference.
  • Loading branch information
FedericoAureliano committed Jun 29, 2024
1 parent 6f3f8da commit cc788ed
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/scala/uclid/lang/TypeChecker.scala
Original file line number Diff line number Diff line change
Expand Up @@ -722,8 +722,8 @@ class ExpressionTypeCheckerPass extends ReadOnlyPass[Set[Utils.TypeError]]

if (funcType1.isInstanceOf[TesterType]) {
val funcType = funcType1.asInstanceOf[TesterType]
val argType = fapp.args.map(typeOf(_, c)).head
checkTypeError(funcType.inType == argType, "Argument type error in application", fapp.pos, c.filename)
val argType = fapp.args.map(typeOf(_, c))
checkTypeError(List(funcType.inType) == argType, "Argument type error in application", fapp.pos, c.filename)
return BooleanType()
}

Expand Down
7 changes: 7 additions & 0 deletions test/test-typecheck-empty-tester.ucl
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module main {
datatype some_adt = some_ctr();

init {
assert is_some_ctr();
}
}

0 comments on commit cc788ed

Please sign in to comment.