We're updating the issue view to help you get more done. 

Excluding MapEntry breaks defrecord

Description

I encountered this problem when trying the pre-release 1.10.126 against a production codebase.

If you do `(:refer-clojure :exclude [MapEntry])` in your namespace declaration and define a record, the record's `seq` implementation is broken. Consider the following code:

1 2 3 4 5 6 7 8 (ns cljs.defrecord-test (:refer-clojure :exclude [MapEntry]) (:require [cljs.test :refer-macros [deftest is]])) (defrecord Foo [a]) (deftest foo-test (= '([:a "test"]) (seq (Foo. "test"))))

You'll get the following compiler warnings:

1 2 WARNING: Use of undeclared Var cljs.defrecord-test/MapEntry at line 5 /Users/miikka/code/clojurescript/src/test/cljs/cljs/defrecord_test.cljs WARNING: Use of undeclared Var cljs.defrecord-test/MapEntry at line 5 /Users/miikka/code/clojurescript/src/test/cljs/cljs/defrecord_test.cljs

The test fails:

1 2 3 4 5 6 Testing cljs.defrecord-test ERROR in (foo-test) (TypeError:NaN:NaN) Uncaught exception, not in assertion. expected: nil actual: #object[TypeError TypeError: kRa.Rh is not a constructor]

If you run the same test without the exclusion, the test passes as expected. In practice this bug prevents the prismatic/schema library from working with the upcoming ClojureScript release.

Environment

ClojureScript 1.10.126

Status

Assignee

Unassigned

Reporter

Miikka Koskinen

Labels

None

Approval

None

Patch

None

Affects versions

1.10.238

Priority

Major