We're updating the issue view to help you get more done. 

Field access on typed record does not preserve type

Description

1 2 3 4 5 6 7 8 9 10 (ns field-test.core (:import [java.util UUID])) (defrecord UUIDWrapper [^UUID uuid]) (defn unwrap [^UUIDWrapper w] (.-uuid w)) ; <- No reflection (defn get-lower-bits [^UUIDWrapper w] (-> w .-uuid .getLeastSignificantBits)) ; <- Reflection :(

The compiler seems to have all the information it needs, but lein check prints

1 Reflection warning, field_test/core.clj:10:3 - reference to field getLeastSignificantBits on java.lang.Object can't be resolved.

(test case also at https://github.com/MichaelBlume/field-test)

Environment

None

Status

Assignee

Unassigned

Reporter

Michael Blume

Approval

None

Patch

None

Affects versions

Release 1.7

Priority

Major