evaluator: fix unary operators on floating point types always throwing a spurious error

This commit is contained in:
a dinosaur 2023-09-12 17:35:25 +10:00
parent a6f9a82e5e
commit a343d5ee65

View File

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