Skip to content

Numeric operators misbehave when in unary position #604

@shantanu-sardesai

Description

@shantanu-sardesai

When we use +, *, etc. (including the promotion operators) jank doesn't make sure that the passed in values are actually numeric.

user=> (* :k)
:k

While Clojure attempts to cast the passed in value to a java.lang.Number.

user=> (* :k)
Execution error (ClassCastException) at java.lang.Class/cast (Class.java:3492).
Cannot cast clojure.lang.Keyword to java.lang.Number

Metadata

Metadata

Labels

category:runtimeActual Clojure code, core libs, and all the C++ code in `jank::runtime`.

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions