mirror of
https://github.com/GayPizzaSpecifications/pork.git
synced 2026-11-04 16:02:20 +00:00
evaluator: fix unary operators on floating point types always throwing a spurious error (#9)
This commit is contained in:
1 parent
a6f9a82e5e
commit
b42ca92d9f
1 file changed
+2
-2
@@ -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 -> {
|
||||||
|
|||||||
Reference in new issue
Block a user