metosin / schema-tools

Clojure(Script) tools for Plumatic Schema
http://metosin.github.io/schema-tools/
Eclipse Public License 2.0
107 stars 16 forks source link

Compiler warnings about `default` with ClojureScript 1.9.655 and later #34

Closed miikka closed 6 years ago

miikka commented 7 years ago

Using schema-tools in a ClojureScript project that is compiled with advanced optimizations using ClojureScript 1.9.655 triggers warnings that look like this:

kesäkuuta 27, 2017 11:09:15 AP. com.google.javascript.jscomp.LoggerErrorManager println                                                                 
WARNING: /Users/miikka/.boot/cache/tmp/Users/miikka/redacted/yzt/ko6id6/js/main.out/schema_tools/core/impl.js:222: WARNING - Keywords and reserved words are not allowed as unquoted property names in older versions of JavaScript. If you are targeting newer versions of JavaScript, set the appropriate language_in option.
return (!((other55787 == null))) && ((this55786__$1.constructor === other55787.constructor)) && (cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(this55786__$1.schema,other55787.schema)) && (cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(this55786__$1.default,other55787.default)) && (cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(this55786__$1.__extmap,other55787.__extmap));

The problematic keyword is default, from the Default record. The ClojureScript compiler doesn't – and possibly can't – munge record field names for reserved keywords. Users of schema-tools can change the :language-in option to work around this or we could rename the field.

See also:

ikitommi commented 6 years ago

Fixed in #36