Skip to main content

L1333 - Record Already Defined Locally

Error

-module(main).
-record(#point {x, y}).
-import_record(other, [point]).
%% ^ error: record point is already defined locally

Explanation

The error occurs when an -import_record attribute tries to import a native record under a name that is already defined locally in the module.

A record name must be unambiguous within a module, so it cannot refer both to a locally defined record and to one imported from another module. To fix the error, either drop the import and use the local record, or rename one of them.