Thread overview | ||||||
---|---|---|---|---|---|---|
|
April 27, 2014 [Issue 11094] Disuniform error messages with overloaded + and ^ operators | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=11094 Andrej Mitrovic <andrej.mitrovich@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |andrej.mitrovich@gmail.com --- Comment #1 from Andrej Mitrovic <andrej.mitrovich@gmail.com> --- Note that it is unrelated to the overloads, you could have a single opBinary to reproduce: ----- struct Foo { Foo opBinary(string op)(in Foo r) if (op == "+" || op == "^") { return Foo(); } } void main() { const x = Foo(); auto r1 = x + Foo(); auto r2 = x ^ Foo(); } ----- -- |
May 26, 2022 [Issue 11094] Disuniform error messages with overloaded + and ^ operators | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=11094 Ben <ben.james.jones@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ben.james.jones@gmail.com --- Comment #2 from Ben <ben.james.jones@gmail.com> --- I took a look at this, and the difference seems to be related to the extra check(s) added at the end of the expressionsem visitors for AddExp vs XorExp: //in xor only if (exp.checkIntegralBin() || exp.checkSharedAccessBin(sc)) return setError(); A couple of questions. This happens earlier in the visitor: Expression e = exp.op_overload(sc); if (e) { result = e; return; } I assume e is null if the op overload doesn't apply (in this case there are constness issues), but putting an error in opover.visitBin seems like maybe the wrong fix? Those extra checks make sense for xor, is it worth trying to add a supplemental error or something that sees if they tried to do op overloading? There's a TON of duplication between the addexp and xorexp visitors in expressionsem, and I assume probably with most binop visitors. Is it worth trying to refactor to reduce the duplication? -- |
December 17, 2022 [Issue 11094] Disuniform error messages with overloaded + and ^ operators | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=11094 Iain Buclaw <ibuclaw@gdcproject.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|P2 |P3 -- |
December 13 [Issue 11094] Disuniform error messages with overloaded + and ^ operators | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=11094 --- Comment #3 from dlangBugzillaToGithub <robert.schadek@posteo.de> --- THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/18675 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB -- |
Copyright © 1999-2021 by the D Language Foundation