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
fix Issue 23928 - improve error msg: scope variable s assigned to non… #15249
Conversation
Thanks for your pull request, @WalterBright! 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#15249" |
…-scope parameter this calling abc
@@ -9,7 +9,7 @@ fail_compilation/test20245.d(27): Error: cannot take address of `scope` variable | |||
fail_compilation/test20245.d(33): Error: reference to local variable `x` assigned to non-scope parameter `ptr` calling `escape` | |||
fail_compilation/test20245.d(34): Error: copying `&x` into allocated memory escapes a reference to parameter `x` | |||
fail_compilation/test20245.d(50): Error: reference to local variable `price` assigned to non-scope `this.minPrice` | |||
fail_compilation/test20245.d(69): Error: reference to local variable `this` assigned to non-scope parameter `msg` calling `this` | |||
fail_compilation/test20245.d(69): Error: reference to local variable `this` calling non-scope member function `this.this()` |
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 message is hard to understand as it makes no mention of types involved.
Perhaps something like this:
fail_compilation/test20245.d(69): Error: reference to local variable `this` calling non-scope member function `this.this()` | |
fail_compilation/test20245.d(69): Error: reference to member variable `DontDoThis.content` calling non-scope member function `Exception.this()` |
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 a good suggestion, but the PR has been pulled. File a bugzilla for it?
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.
…-scope parameter this calling abc