evaluator: fix unary operators on floating point types always throwing a spurious error (#9)

This commit is contained in:
a dinosaur
2023-09-12 17:40:13 +10:00
committed by GitHub
parent a6f9a82e5e
commit b42ca92d9f

View File

@ -117,7 +117,7 @@ class EvaluationVisitor(root: Scope) : NodeVisitor<Any> {
convert = { it.toDouble() },
plus = { +it },
minus = { -it },
binaryNot = unaryFloatingPointTypeError("binary not")
binaryNot = { unaryFloatingPointTypeError("binary not") }
)
}
is Float -> {
@ -127,7 +127,7 @@ class EvaluationVisitor(root: Scope) : NodeVisitor<Any> {
convert = { it.toFloat() },
plus = { +it },
minus = { -it },
binaryNot = unaryFloatingPointTypeError("binary not")
binaryNot = { unaryFloatingPointTypeError("binary not") }
)
}
is Long -> {