You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
class Foo {
Foo opBinary(string op)(ref Foo) {
return null;
}
}
void main() {
auto f = new Foo;
auto r1 = f * f; // OK
auto r2 = f * (new Foo); // Error.
}
DMD 2.064alpha gives:
test.d(9): Error: 'f' is not of arithmetic type, it is a test.Foo
test.d(9): Error: 'new Foo' is not of arithmetic type, it is a test.Foo
I think that's a bug. Even if that's not a bug, then I suggest to improve the error messages.
The text was updated successfully, but these errors were encountered:
bearophile_hugs reported this on 2013-06-04T04:55:45Z
Transferred from https://issues.dlang.org/show_bug.cgi?id=10263
Description
class Foo { Foo opBinary(string op)(ref Foo) { return null; } } void main() { auto f = new Foo; auto r1 = f * f; // OK auto r2 = f * (new Foo); // Error. } DMD 2.064alpha gives: test.d(9): Error: 'f' is not of arithmetic type, it is a test.Foo test.d(9): Error: 'new Foo' is not of arithmetic type, it is a test.Foo I think that's a bug. Even if that's not a bug, then I suggest to improve the error messages.The text was updated successfully, but these errors were encountered: