sci icon indicating copy to clipboard operation
sci copied to clipboard

Unexpected error when implementing methods on Object

Open borkdude opened this issue 1 year ago • 0 comments

bb -e "(deftype RingBuffer [head tail] Object (pop [_]))"
----- Error --------------------------------------------------------------------
Type:     clojure.lang.ExceptionInfo
Message:  Could not resolve symbol: sci.impl.records/pop
Phase:    analysis

Same with nbb.

Error in Clojure JVM:

Can't define method not in interfaces: pop

Apparently in CLJS it's valid to implement any method on Object:

plk -e "(deftype RingBuffer [head tail] Object (pop [_])) (.pop (->RingBuffer 1 []))"

borkdude avatar Oct 27 '22 10:10 borkdude