case statement with embedded list test constant

Description

The following works in Clojure, but fails to compile in ClojureScript:

In ClojureScript this results in an analysis error

Environment

None

Activity

Show:
Elton Law
March 31, 2020, 9:46 PM
Edited

Sorry about that. Attached an updated version of the patch. Applied to updated local version of master and tests ran successfully.

Mike Fikes
March 29, 2020, 7:52 PM

CLJS-3173.patch has conflicts with master

Mike Fikes
November 23, 2019, 6:37 PM
Edited

CLJS-3173.patch

Travis

Details

AppVeyor

Details

Canary

Details

Patch Tender

Details

Elton Law
November 23, 2019, 8:52 AM
Edited

Hi, sorry first time doing this, please let me know if I missed anyting, here’s the explanation behind the patch:

Calling const? on an embedded list, cljs.analyzer/resolve-var is
called on the last element of the list which is why this is raised:

An extra condition is added so that only vars are being sent to
resolve-var:

This leads to another error:

Which comes from the macroexpansion creating something like

There's already a bit in the preprocessing of the test-then pairs where
anything that's a symbol is quoted. Just need to add seq as another
instance where that's needed.

 

Assignee

Mike Fikes

Reporter

Mike Fikes

Labels

None

Approval

None

Patch

Code and Test

Priority

Major