Skip to main content

L1341 - Badly Formed export_record

Error

-module(main).
-record(#point {x, y}).
-export_record(point).
%%<^^^^^^^^^^^^^^^^ error: badly formed -export_record(); expected a list of record names

Explanation

The error occurs when the argument of an -export_record attribute is not a list of record names.

The attribute expects a list of atoms, for example -export_record([point, line]).. To fix the error, wrap the record name(s) in a list.