Permalink
Browse files

Allow defrecord to declare a record type without fields

  • Loading branch information...
1 parent f7cad1c commit 90d0fa3cd5d42fdb1779c1ee349d5505e4865cba @devinus committed Mar 28, 2013
Showing with 2 additions and 2 deletions.
  1. +1 −1 lib/elixir/lib/kernel.ex
  2. +1 −1 lib/elixir/test/elixir/record_test.exs
View
2 lib/elixir/lib/kernel.ex
@@ -1427,7 +1427,7 @@ defmodule Kernel do
When defining a type, all the fields not mentioned in the type are
assumed to have type `term`.
"""
- defmacro defrecord(name, fields, opts // [], do_block // []) do
+ defmacro defrecord(name, fields // [], opts // [], do_block // []) do
Record.defrecord(name, fields, Keyword.merge(opts, do_block))
end
View
2 lib/elixir/test/elixir/record_test.exs
@@ -4,7 +4,7 @@ defrecord RecordTest.FileInfo,
Record.extract(:file_info, from_lib: "kernel/include/file.hrl")
defrecord RecordTest.SomeRecord, a: 0, b: 1
-defrecord RecordTest.WithNoField, []
+defrecord RecordTest.WithNoField
name = RecordTest.DynamicName
defrecord name, a: 0, b: 1 do

0 comments on commit 90d0fa3

Please sign in to comment.