You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(defclassA
(constructor [this]
(js/console.log"A.constructor"))
Object
(whatever [this a b]
(js/console.log"A.whatever" a b)
(+ a b)))
(defclassB
(extends A)
(constructor [this]
(super)
(js/console.log"B.constructor"))
Object
(whatever [this a b]
(js/console.log"B.whatever")
;; (.whatever super a b) super not declared
(.whatever (js*"super") a b)))
(js/console.log (.whatever (B.) 12))
This should work but doesn't this super doesn't exist. Can't emulate it either via (js* "super") since the Object methods are just "attached" to the class via extend-type. Only the constructor is actually emitted as part of the class and the rest is then attached via B.prototype.whatever = function(...) { ... };, but the problem is that super is not available in that context, only directly in class methods.
A workarround is (.. A -prototype -whatever (call this a b)) but thats not great and emits an inference warning.
Should most likely lift Object method declarations out of the extend-type and directly into the class body. Will think about it for a bit.
The text was updated successfully, but these errors were encountered:
generates
This should work but doesn't this
super
doesn't exist. Can't emulate it either via(js* "super")
since theObject
methods are just "attached" to theclass
viaextend-type
. Only theconstructor
is actually emitted as part of theclass
and the rest is then attached viaB.prototype.whatever = function(...) { ... };
, but the problem is thatsuper
is not available in that context, only directly inclass
methods.A workarround is
(.. A -prototype -whatever (call this a b))
but thats not great and emits an inference warning.Should most likely lift
Object
method declarations out of theextend-type
and directly into theclass
body. Will think about it for a bit.The text was updated successfully, but these errors were encountered: