Allow out-of-line operator definitions

This commit is contained in:
Peter Li 2026-10-31 11:33:41 -07:00
parent 06bfbe2a06
commit 40292bfced
1 changed files with 1 additions and 1 deletions

View File

@ -1901,7 +1901,7 @@ pub const Sema = struct {
s.err(d.loc, "overloading '{s}' is not allowed", .{name}); s.err(d.loc, "overloading '{s}' is not allowed", .{name});
return; return;
}; };
if (owner == null) { if (owner == null and f.name.parts.len == 1) {
s.err(d.loc, "overloading non-member '{s}' is not allowed", .{name}); s.err(d.loc, "overloading non-member '{s}' is not allowed", .{name});
return; return;
} }