No need to leave Clojure to see what's going on:

(definterface IntTest
  (intTest [^int n])
  (intTest [^long n]))

(deftype IntTester []
  IntTest
  (intTest [this ^int n] (println "A primitive int!"))
  (intTest [this ^long n] (println "A primitive long!")))

(comment
  (.intTest (IntTester.) 1) ; "A primitive long!"
  (.intTest (IntTester.) (int 1)) ; "A primitive int!"
  )

On Sun, Sep 18, 2011 at 11:04 AM, Meikel Brandmeyer <m...@kotka.de> wrote:

> Hi,
>
> Am 18.09.2011 um 15:36 schrieb Brent Millare:
>
> > Even if I use what type does underneath and call .getClass myself (so
> > there is no boxing), I still get type long. Also to be more specific,
> > I am interested in the primitive int, not java.lang.Integer.
>
> You could do a hardcore try and use a specific class:
>
> class IntTest {
>    static void testMethod(long i) { System.out.println("Long!"); }
>    static void testMethod(int i) { System.out.println("Integer!"); }
> }
>
> And then try: (IntTest/testMethod (int 0)). This should tell clearly what
> is used after the int “cast”, no?
>
> Sincerely
> Meikel
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to