New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Partial fix issue 19294 - Support for array operations with Complex! is incomplete #13154
Partial fix issue 19294 - Support for array operations with Complex! is incomplete #13154
Conversation
Thanks for your pull request and interest in making D better, @sorin-gabriel! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please see CONTRIBUTING.md for more information. If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment. Bugzilla references
Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub run digger -- build "master + dmd#13154" |
Please add the test case(s) from the bug report. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since this is a partial fix, please remove the word fix
from the commit message of the first commit since this doesn't completely fix the issue. (the bot should update its message to reflect that fact).
test/compilable/b19294.d
Outdated
@@ -0,0 +1,26 @@ | |||
import std.stdio; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is not needed
test/compilable/b19294.d
Outdated
@@ -0,0 +1,26 @@ | |||
import std.stdio; | |||
import std.complex; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
replace this with an inline definition of Complex
the test suite is not allowed t depend on the standard library. a simple
struct Complex(T)
{
T re, im;
// Methods (i.e. opBinary and opBinaryRight) + alias this
// and anything else necessary to reproduce the bug
}
should suffice, no need for the body of the methods, just a return this;
should be fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue is not with Complex, but with any user-defined type that has an opBinary
.
test/compilable/b19294.d
Outdated
import std.stdio; | ||
import std.complex; | ||
|
||
void main() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test functions in compilable
should not be main
functions.
You still need to rebase to get rid of "Fix" from the commit message. |
e6d32b9
to
225841d
Compare
225841d
to
475eb7e
Compare
…omplex! is incomplete (dlang#13154)" This reverts commit cc4e83b.
Wanted to click "View details", but clicked on "Revert" instead. Please ignore. |
…plete (partial fix, only for operands of the same type)
The git diff isn't very helpful here, as the only real changes are the removal of the return statement and the outer if condition. The if condition is redundant and the early return caused the compiler to throw errors for array operations like
T[] op T
orT op T[]
This is a partial fix for the issue, as
T[] op U
,U op T[]
orT[] op U[]
still aren't covered, even when op overload is defined.