Carp icon indicating copy to clipboard operation
Carp copied to clipboard

REPL: Top level forms sometimes don't resolve forms correctly

Open scolsen opened this issue 4 years ago • 1 comments

The repl will state that e.g. it doesn't understand Array.push-back! and other forms when they are used at the top level in non-functions:

(let [x (Array.push-back! &[1 2 3] 4)] x)
I did not understand the form `(deftemplate Array.push-back!)` at Array.push-back!.parameterizedTemplate:0:0.

Traceback:
  (Array.push-back! (ref [1 2 3]) 4) at REPL:3:9.
(let [x (Array.push-back! (ref [1 2 3]) 4)] x) at REPL:3:1.
(do (Array.push-back! (ref [1 2 3]) 4) (str 4))
I did not understand the form `(deftemplate Array.push-back!)` at Array.push-back!.parameterizedTemplate:0:0.

Traceback:
  (Array.push-back! (ref [1 2 3]) 4) at REPL:4:5.
(do (Array.push-back! (ref [1 2 3]) 4) (str 4)) at REPL:4:1.

The same error happens for interfaces too.

scolsen avatar Aug 04 '21 14:08 scolsen

The error comes from the type error InvalidObj which is only generated in InitialTypes.hs, so that's a clue.

eriksvedang avatar Aug 05 '21 05:08 eriksvedang