clojure-dev

Issues: https://clojure.atlassian.net/browse/CLJ | Guide: https://insideclojure.org/2015/05/01/contributing-clojure/
thheller 2019-02-20T09:29:03.054Z

any hints on what may cause this?

ClassCastException: clojure.lang.KeywordLookupSite$1 incompatible with clojure.lang.IFn
        clojure.spec.alpha/spec-impl/reify--1987 (alpha.clj:875)
        clojure.spec.alpha/conform (alpha.clj:150)
        clojure.spec.alpha/conform (alpha.clj:146)
        clojure.spec.alpha/macroexpand-check (alpha.clj:685)
        clojure.spec.alpha/macroexpand-check (alpha.clj:681)
        clojure.lang.Var.invoke (Var.java:385)
        cljs.analyzer/do-macroexpand-check (analyzer.cljc:3312)
        cljs.analyzer/do-macroexpand-check (analyzer.cljc:3306)
        cljs.analyzer/macroexpand-1* (analyzer.cljc:3326)
        cljs.analyzer/macroexpand-1* (analyzer.cljc:3314)
        cljs.analyzer/macroexpand-1 (analyzer.cljc:3375)
        cljs.analyzer/macroexpand-1 (analyzer.cljc:3371)
        cljs.analyzer/analyze-seq (analyzer.cljc:3408)
        cljs.analyzer/analyze-seq (analyzer.cljc:3388)

thheller 2019-02-20T09:30:20.054400Z

never seen this problem before and don't know where to start looking https://github.com/thheller/shadow-cljs/issues/443

2019-02-20T15:55:01.000700Z

@thheller Given that it is ClojureScript, you may also want to check in #cljs-dev channel

thheller 2019-02-20T15:57:20.002100Z

thx but I'm quite familiar with the CLJS side of things, this seems to be something on the CLJ side

alexmiller 2019-02-20T16:15:49.002400Z

new to me

alexmiller 2019-02-20T16:16:46.002900Z

but smells classloadery to me

alexmiller 2019-02-20T16:17:05.003300Z

like a fn compiled with IFn from a different classloader

bronsa 2019-02-20T16:18:53.003700Z

nah

bronsa 2019-02-20T16:19:10.003900Z

it's leaking an inner class of KLS

alexmiller 2019-02-20T16:19:22.004100Z

"it"

bronsa 2019-02-20T16:19:34.004700Z

something is invoking this object as a function

alexmiller 2019-02-20T16:19:43.005100Z

oh, gotcha

bronsa 2019-02-20T16:19:47.005300Z

a bad implementation of ILookupSite

bronsa 2019-02-20T16:20:02.005800Z

or whichever of those interfaces you need to implement :)

bronsa 2019-02-20T16:20:19.006Z

I can never remember

ghadi 2019-02-20T16:21:15.006300Z

this is the second time I've seen this in a couple weeks

bronsa 2019-02-20T16:21:35.007100Z

either that, or there's something broken in the inline keyword lookup cache

2019-02-20T16:21:37.007300Z

I’ve seen an error like this “bad lookup site” before

ghadi 2019-02-20T16:21:38.007500Z

same "impossible" situation with the innards of a KLS

2019-02-20T16:21:45.008Z

discussed it inthis channel to

bronsa 2019-02-20T16:21:50.008400Z

but that would be really surprising to me

2019-02-20T16:22:03.008700Z

with @ghadi contributing to that discussion before too I think - not sure what I had before and think we never found the answer

2019-02-20T16:22:43.009700Z

but don’t think it had anything to do with cljs and wasn’t using shadow I’m sure

bronsa 2019-02-20T16:23:06.010100Z

@ghadi I mean it's not really an impossible situation, just impossible provided you're not handling KLS manually I think?

bronsa 2019-02-20T16:23:27.010600Z

you can access that thunk using fault

2019-02-20T16:23:34.010800Z

I wasn’t doing anything weird

2019-02-20T16:23:40.011100Z

a kw site was just failing magically

bronsa 2019-02-20T16:23:47.011500Z

interesting

2019-02-20T16:23:51.011800Z

wasn’t trying to get down and manually call the callsite thunk or anything

ghadi 2019-02-20T16:23:58.012Z

^ that's all I need -- user wasn't doing anything weird

ghadi 2019-02-20T16:24:02.012300Z

need a repro case

2019-02-20T16:24:11.012500Z

well, obviously you do, hah

ghadi 2019-02-20T16:24:24.013Z

could tooling be doing weird things?

2019-02-20T16:24:25.013100Z

just saying “hey, I’ve saw this and tried to discuss similar recently”

ghadi 2019-02-20T16:25:26.013900Z

seriously thank you for chiming in - I couldn't remember the details

2019-02-20T16:25:36.014300Z

ah, was clara-rules and core.async in my case

2019-02-20T16:25:44.014700Z

so there were threads involved

2019-02-20T16:25:47.015Z

and that’s all I ever knew

ghadi 2019-02-20T16:26:00.015700Z

common tooling maybe? CIDER etc?

2019-02-20T16:26:06.015900Z

and we thought - perhaps the record type was being redef’ed so hitting the non-`identical?` branch of the callsite check

bronsa 2019-02-20T16:26:24.016200Z

but that shouldn't leak

bronsa 2019-02-20T16:26:40.016800Z

the bytecode the compiler emits should handle that case cleanly

bronsa 2019-02-20T16:26:51.017300Z

it's very strange

2019-02-20T16:27:02.017700Z

not sure on tooling, it was actually a reported problem I was trying to diagnose. so yeah, not adding enough useful info here sadly.

2019-02-20T16:27:15.018100Z

I was surprised at it being able to leak at all though indeed.

2019-02-20T16:27:44.018500Z

I tried for a while at the repl to manipulate things enough to cause it, with like redefining things etc, had no success