Skip to content

Commit be7e0aa

Browse files
fix documentation about undefined_field
Summary: - as title, the previous paragraph was wrong Reviewed By: VLanvin Differential Revision: D66246696 fbshipit-source-id: 440f08d37633d054f0fe158e877714407150c0ca
1 parent 759af3c commit be7e0aa

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

docs/reference/errors.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,18 @@ test_neg() ->
151151

152152
### undefined_field
153153

154-
This error occurs when attempting to create a record with a field that does not exist.
154+
This error occurs when attempting to create a record without specifying the value for a field
155+
when the field type doesn't allow `undefined` values.
156+
157+
Example:
158+
```Erlang
159+
-record(user, {name :: string(), id :: binary()}).
160+
161+
-spec create_user() -> #user{}.
162+
create_user() -> #user{id = <<"000">>}.
163+
164+
% #user{...}: name is undefined
165+
```
155166

156167

157168
### unbound_var

0 commit comments

Comments
 (0)