Fork me on GitHub
#cljs-dev
<
2019-06-11
>
Roman Liutikov13:06:30

Why this code emits inference warnings?

(set! *warn-on-infer* true)

(defprotocol IComment
  (send+ [c s]))

(deftype Comment []
  IComment
  (send+ [c s] s))

(send+ (Comment.) "asd")

Roman Liutikov13:06:36

Iā€™m on 1.10.520

Roman Liutikov13:06:22

does this still require type hinting?

dnolen14:06:42

there's issues w/ deftype/record and inference

dnolen14:06:49

I would just move that stuff to a different ns

dnolen14:06:53

for now if you want to avoid

thheller16:06:44

or just use the (set! *warn-on-infer* true) after the defrecord/deftype šŸ˜‰

šŸ‘ 4