Skip to content

[clojure-test-suite] Analysis issues #637

@shantanu-sardesai

Description

@shantanu-sardesai

Description

This ticket contains a list of analysis bugs/features that need to be completed to get the test suite running. This is not an exhaustive list and will be amended as and when more issues are discovered.

Issues

1. Scope issue with doseq

The 2nd local variable introduced using doseq doesn't seem to considered during analysis.

user=> (doseq [_ [] x [1 2 3]] x)
─ analyze/unresolved-symbol ───────────────────────────────────────────────
error: Unable to resolve symbol 'x'.

─────┬─────────────────────────────────────────────────────────────────────
     │ /var/folders/xd/9v1dcg0d46l7d19830vq0lhc0000gn/T/jank-repl-26Px6h
─────┼─────────────────────────────────────────────────────────────────────
  1  │ (doseq [_ [] x [1 2 3]] x)
     │                         ^ Found here.
     │ ^ Expanded from this macro.
─────┴─────────────────────────────────────────────────────────────────────

2. Using aset

Invalid usage of a binary operator is observed on macro expansion.

user=> (defn foo [a] (aset a 0 1))
─ analyze/invalid-cpp-operator-call ────────────────────────────────────────────────────────────────
error: Binary operator aget is not supported for 'jank::runtime::object *' and
       'jank::runtime::object *'.
─────┬──────────────────────────────────────────────────────────────────────────────────────────────
     │ …shantanusardesai/Desktop/code/projects/jank/compiler+runtime/src/jank/clojure/core.jank
─────┼──────────────────────────────────────────────────────────────────────────────────────────────
5652 │     (let [val (first more)]
5653 │       `(do
5654 │          (cpp/= (cpp/aget ~array ~idx) ~val)
     │                  ^^^^^^^^ Found here.
─────┴──────────────────────────────────────────────────────────────────────────────────────────────
─────┬──────────────────────────────────────────────────────────────────────────────────────────────
     │ /var/folders/xd/9v1dcg0d46l7d19830vq0lhc0000gn/T/jank-repl-ey8hqG
─────┼──────────────────────────────────────────────────────────────────────────────────────────────
  1  │ (defn foo [a] (aset a 0 1))
     │               ^ Expanded from this macro.
─────┴──────────────────────────────────────────────────────────────────────────────────────────────

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions