cljs.core/resolve fails under :advanced compilation (regression)

Description

The macro cljs.core/resolve does not produce sufficient information to invoke (when using :advanced compilation) a function across module boundaries under certain conditions.

With :advanced compilation, the attempt of module A to invoke the function in module B after load then fails at runtime. The issue occurs when using 1.10.238, but does not occur when using 1.9.946.

A minimal repro is provided below:

deps.edn

1 {:deps {org.clojure/clojurescript {:mvn/version "1.10.238"}}}

build.edn

1 2 3 4 5 6 7 8 9 {:output-dir "out" :optimizations :none :modules {:a {:output-to "out/a.js" :entries [demo.a]} :b {:output-to "out/b.js" :entries [demo.foo.b] :depends-on #{:a}}} :verbose true}

src/demo/a.cljs

1 2 3 (ns demo.a) (resolve 'demo.foo.b/bar)

src/demo/foo/b.cljs

1 2 3 (ns demo.foo.b) (defn bar [] :bar)

index.html

1 2 3 4 5 6 <html> <body> <script src="out/cljs_base.js"></script> <script src="out/a.js"></script> </body> </html>

The repro can be compiled by running clj -m cljs.main -co build.edn -c

Environment

None

Status

Assignee

Unassigned

Reporter

Pieter du Toit

Labels

None

Approval

Screened

Patch

None

Affects versions

1.10.238

Priority

Major
Configure