tools.emitter.jvm

Emit unchecked locals

Details

  • Type: Enhancement Enhancement
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None

Description

At present, TEMJVM emits checked code for hinted locals. This isn't correct according to clojure.org, which states that tags are not enforced and and are for reflection elimination rather than Java style static typing.

This issue manifests itself when loading clojure.core/ns-publics, which makes use of a ^clojure.lang.Namespace hinted argument but is expected to accept the java.lang.Object domain as per the stated hinting behavior of clojure.

The fix is to adopt Clojure's checkcast style, in that locals are not type hinted more precisely than Object, nor are function arguments. Only interop sites should actually emit checkcasts.

This behavior is arguably silly but it prevents TEMJVM from self-hosting so there it is.

Activity

There are no comments yet on this issue.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated: