0

Trying to use one type from another type doesn't seem to work:

(deftype Foo [^int a ^int b])
(definterface Bars (^Foo makefoo []))

(deftype Bar [^int a ^int b] Bars (^Foo makefoo [this] (Foo. 1 2)))
;java.lang.NoClassDefFoundError: java/lang/Foo.

How do I get Foo to be visible to Bar?

Kevin Kostlan
  • 3,311
  • 7
  • 29
  • 33
  • I don't know what's going wrong here, but if you remove all of the hints, it compiles just fine. – noisesmith Oct 04 '15 at 01:04
  • Too bad, I need hints for performance because this is the bottleneck and native java was 50 times faster in the profile! Strange that it works without hints. Maybe it has to do with the dynamic lookup working but the static lookup not? – Kevin Kostlan Oct 04 '15 at 02:06
  • `java/lang/Foo` sounds like a wrong namespace is being looked up. Did you check the solution posted below? – D-side Oct 14 '15 at 16:43

1 Answers1

3

If you specify the full namespace for the hint in definterface, everything seems to work correctly.

(ns com.bar)

(definterface Bars 
  (^com.bar.Foo makefoo []))
rabidpraxis
  • 556
  • 3
  • 10