Clojure

1.3 alpha1 gives reflection warning in a case where 1.2 does not

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Declined
  • Affects Version/s: None
  • Fix Version/s: Backlog
  • Component/s: None
  • Labels:
    None
  • Approval:
    Incomplete

Description

Feel free to reclassify this as something other than a bug if I've misclassified it.

Related Clojure Google group conversation: http://groups.google.com/group/clojure/browse_thread/thread/83c08f6c2f313c50#

When doing AOT compilation on the attached program nbody.clj with 1.2:

java -Dclojure.compile.path=. -cp clojure-1.2.0.jar:. clojure.lang.Compile nbody

there are no reflection warnings, and a more complex version of the program using the type Body runs quickly. When doing AOT compilation with 1.3 alpha1:

java -Dclojure.compile.path=. -cp clojure-1.3.0-alpha1.jar:. clojure.lang.Compile nbody

I see these reflection warnings, and a more complex version of the program using the type Body runs significantly more slowly, most likely due to the reflection warned about:

Reflection warning, nbody.clj:18 - reference to field x can't be resolved.
Reflection warning, nbody.clj:19 - reference to field y can't be resolved.

Changing the name of the file to nbod.clj and the first line to "(ns nbod", and making corresponding changes to the compilation commands above, causes the reflection warnings to go away in 1.3 alpha1.

Similarly, taking the original attached file nbody.clj and replacing the three occurrences of "nbody" that are not the namespace name with a different name like "nbod" (or probably any name other than "nbody") also causes the reflection warnings to go away in 1.3 alpha1.

In case it makes any difference, I was using Clojure jars pulled via Leiningen, and HotSpot 1.6.0_xxx JVMs on Mac OS X 10.5.8 and Ubuntu 10.4.

Admittedly, a change with very limited impact on typical Clojure users. I wanted to file a ticket in case this was an unwanted consequence of some desirable change in 1.3.

Activity

Hide
Assembla Importer added a comment -

ataggart said: Fix available via #445.

Show
Assembla Importer added a comment - ataggart said: Fix available via #445.
Hide
Stuart Sierra added a comment -

Marking "Incomplete" because no patch is included.

Furthermore, I cannot reproduce the problem described using Clojure 1.3.0.

Show
Stuart Sierra added a comment - Marking "Incomplete" because no patch is included. Furthermore, I cannot reproduce the problem described using Clojure 1.3.0.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: