Skip to content

Commit

Permalink
Document that default values in records must not use variables
Browse files Browse the repository at this point in the history
Closes #8166
  • Loading branch information
bjorng committed Feb 22, 2024
1 parent 4e5e268 commit c35413a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions system/doc/reference_manual/ref_man_records.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,14 @@ given an optional default value. If no default value is supplied, `undefined` is
used.

```erlang
-record(Name, {Field1 [= Value1],
-record(Name, {Field1 [= Expr1],
...
FieldN [= ValueN]}).
FieldN [= ExprN]}).
```

The default value for a field is an arbitrary expression, except that it must
not use any variables.

A record definition can be placed anywhere among the attributes and function
declarations of a module, but the definition must come before any usage of the
record.
Expand Down

0 comments on commit c35413a

Please sign in to comment.