cljs-dev

ClojureScript compiler & std lib dev, https://clojurescript.org/community/dev
gdanov 2021-06-11T10:35:18.168500Z

Hi, just hit compatibility issue re protocols & metadata

alexmiller 2021-06-11T12:18:47.169800Z

I would consider this a bug. The ordering of choices was carefully chosen here in Clojure.

gdanov 2021-06-11T13:51:24.169900Z

great, I could not find jira ticket for this so I guess there isn’t.

gdanov 2021-06-11T14:04:39.170100Z

btw satisfies? returns false when protocol is implemented via meta. the behavior in this case is not documented in the function doc.

dnolen 2021-06-11T14:16:00.170600Z

https://clojure.atlassian.net/browse/CLJS-3313

👍 1
alexmiller 2021-06-11T14:16:57.170700Z

that is a separate issue and does have a CLJ jira

alexmiller 2021-06-11T14:18:05.170900Z

https://clojure.atlassian.net/browse/CLJ-2426

gdanov 2021-06-11T14:23:51.171100Z

thanks. should’ve searched it

thheller 2021-06-11T14:31:07.172600Z

my bad on that one. currently pretty busy but I can try to squeeze in a patch if you want, maybe next week.

dnolen 2021-06-11T15:03:00.172800Z

@thheller no worries, I'm looking at it

Brice Ruth 2021-06-11T15:18:07.173500Z

Posted this in #clojurescript, not realizing this channel existed, but thinking it's maybe more appropriate here?

borkdude 2021-06-11T15:20:04.173900Z

@bdruth This channel is for CLJS compiler and std lib dev

Brice Ruth 2021-06-11T15:20:38.174500Z

ohhh, gotcha - my bad, I misinterpreted. apologies! /me slinks back to #clojurescript 😉

thheller 2021-06-11T20:20:42.177100Z

@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

dnolen 2021-06-11T20:21:05.177500Z

@thheller the tests are advanced compiled and tested locally first

dnolen 2021-06-11T20:22:03.178100Z

but I agree about that case being a possibility

dnolen 2021-06-11T20:25:28.178800Z

ah there is an edge case

thheller 2021-06-11T20:25:30.179100Z

hmm odd. thought static-fns was the only thing affecting that but maybe not

dnolen 2021-06-11T20:25:36.179300Z

but only in the predicate fn path

dnolen 2021-06-11T20:25:52.179800Z

i.e. implements?

dnolen 2021-06-11T20:26:10.180200Z

but that cannot happen in this case anyway I don't think

dnolen 2021-06-11T20:26:51.180700Z

but I think pretty edge-casey and this will solve most expectations for now

thheller 2021-06-11T20:29:20.181900Z

hmm I thought the protocol property check was the default (with static-fns) rather than an edge case

thheller 2021-06-11T20:31:50.182800Z

(let [x (with-meta (SomeMetaImpl. 2) {`ext-meta-protocol (fn [_] 1)})]
  (is (= 1 (ext-meta-protocol x))))

thheller 2021-06-11T20:32:03.183500Z

this should fail then I think

dnolen 2021-06-11T20:33:37.184800Z

Will test that later but the fjnal branch is not protocol stuff it’s just arity invoke

dnolen 2021-06-11T20:34:05.185800Z

Protocol inlining is proto? Branch

thheller 2021-06-11T20:35:01.186500Z

ah yeah right thats just IFn. sorry too tired for this 😛