Hi, just hit compatibility issue re protocols & metadata
I would consider this a bug. The ordering of choices was carefully chosen here in Clojure.
great, I could not find jira ticket for this so I guess there isn’t.
btw satisfies? returns false when protocol is implemented via meta. the behavior in this case is not documented in the function doc.
that is a separate issue and does have a CLJ jira
thanks. should’ve searched it
vote https://ask.clojure.org/index.php/4622/satisfies-doesnt-work-instance-based-protocol-polymorphism?show=4622#q4622 if you like
my bad on that one. currently pretty busy but I can try to squeeze in a patch if you want, maybe next week.
@thheller no worries, I'm looking at it
Posted this in #clojurescript, not realizing this channel existed, but thinking it's maybe more appropriate here?
@bdruth This channel is for CLJS compiler and std lib dev
ohhh, gotcha - my bad, I misinterpreted. apologies! /me slinks back to #clojurescript 😉
https://github.com/clojure/clojurescript/commit/01c65fe2b8e038cda00e2e565f2750dbfd81b596
@dnolen I think that still fails with :static-fns true
. the direct property check/invoke still happens before hitting the dispatch function. somewhere in emit*
:invoke
IIRC
@thheller the tests are advanced compiled and tested locally first
but I agree about that case being a possibility
ah there is an edge case
hmm odd. thought static-fns was the only thing affecting that but maybe not
but only in the predicate fn path
i.e. implements?
but that cannot happen in this case anyway I don't think
but I think pretty edge-casey and this will solve most expectations for now
hmm I thought the protocol property check was the default (with static-fns) rather than an edge case
https://github.com/clojure/clojurescript/blob/master/src/main/clojure/cljs/compiler.cljc#L1242
(let [x (with-meta (SomeMetaImpl. 2) {`ext-meta-protocol (fn [_] 1)})]
(is (= 1 (ext-meta-protocol x))))
this should fail then I think
Will test that later but the fjnal branch is not protocol stuff it’s just arity invoke
Protocol inlining is proto? Branch
ah yeah right thats just IFn. sorry too tired for this 😛