Invalid defrecord results in exception attributed to namespace that imports namespace with defrecord

Description

I was introducing a namespace that included a defrecord.

My defrecord was wrong; it used a keyword to define a field, not a symbol. Minimal test case:

However, the exception was perplexing:

The error was attributed to app.clj (useclj16.app), a namespace which requires useclj16.init, the namespace containing the defrecord.

No indication that this concerned a defrecord, or even what namespace contained the error, was present in the exception.

Patch: clj-1261-5.diff

Approach: Check explicitly that the fields are all symbols, for both defrecord and deftype, and throw a CompilerException with file, line, and column number if not. Example of exception after patch is applied, in the case give above:

Screened by: Alex Miller

Environment

None

Assignee

Unassigned

Reporter

Howard Lewis Ship

Labels

Approval

Ok

Patch

Code and Test

Fix versions

Affects versions

Priority

Minor
Configure