D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 11443 - Misleading error for mismatch overloaded operator if there are immutable members
Summary: Misleading error for mismatch overloaded operator if there are immutable members
Status: NEW
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 major
Assignee: No Owner
URL:
Keywords: diagnostic
Depends on:
Blocks:
 
Reported: 2013-11-05 05:51 UTC by Denis Shelomovskii
Modified: 2024-12-13 18:13 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Denis Shelomovskii 2013-11-05 05:51:47 UTC
---
struct S
{
    const int i;
    void opOpAssign(string op : "+")(int) { }
    void opOpAssign(string op : "~")(int) { }
}

void main()
{
    S s;
    s += ""; // Error: cannot modify struct s S with immutable members
    s ~= ""; // Error: cannot modify struct s S with immutable members
}
---
Comment 1 dlangBugzillaToGithub 2024-12-13 18:13:43 UTC
THIS ISSUE HAS BEEN MOVED TO GITHUB

https://github.com/dlang/dmd/issues/17623

DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB