Skip to content

Commit

Permalink
Improve error message for dup'd type field names.
Browse files Browse the repository at this point in the history
  • Loading branch information
ihnorton committed Aug 28, 2015
1 parent 099dfd1 commit 327bb28
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/julia-syntax.scm
Original file line number Diff line number Diff line change
Expand Up @@ -935,6 +935,8 @@
(default-inner-ctors name field-names field-types (null? params) locs)
defs))
(min-initialized (min (ctors-min-initialized defs) (length fields))))
(let ((dups (has-dups field-names)))
(if dups (error (string "duplicate field name: \"" (car dups) "\" is not unique"))))
(for-each (lambda (v)
(if (not (symbol? v))
(error (string "field name \"" (deparse v) "\" is not a symbol"))))
Expand Down

0 comments on commit 327bb28

Please sign in to comment.