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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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 -> {