-
-
Notifications
You must be signed in to change notification settings - Fork 608
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 20691 - Converting scope static array to scope dynamic arra… #10951
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#10951" |
47c1cd7
to
0ecc3d5
Compare
|
Added a link in 20691 to 20505 (why the duplication ??). |
bee84dd
to
897912a
Compare
I originally thought it was a different problem.
Yes. Scope is not transitive. |
|
Unfortunately, several projects in buildkite are relying on this compiler bug. |
Then why do Also, can you renamed the commit title to |
We discussed this a million time, but I'm going to repeat it anyway: anyone trying to do something useful with I tested this PR with some sample code, and this still compiles: import std.stdio;
struct Bar
{
const(char)[] v;
}
struct Store
{
Bar[] v;
}
void main () @safe
{
auto v = func1();
writeln(v);
}
const(char)[] func1 () @safe
{
char[10] str = 'a';
return func2(str);
}
const(char)[] func2 (scope const(char)[] b) @safe
{
Bar[10] array = Bar(b);
return func3(array, b);
}
const(char)[] func3 (scope Bar[] array, scope const(char)[] b) @safe
{
Store st = Store(array);
return st.v[0].v;
} |
|
Any update on this ? |
e060bd2
to
6d46bb5
Compare
please add bug report. |
I did, it's the one you are trying to fix (https://issues.dlang.org/show_bug.cgi?id=20505). |
|
@Geod24 as for transitive scope, while a good idea, that would be a fairly major project, way beyond the scope of this PR. It is likely to also break much existing code. |
I'll merge the druntime PR in the meantime. |
|
Now that the blocker from Phobos has been fixed, can this be merged? I assume the failing test runs are old and should go away after a rebase. |
|
@WalterBright @RazvanN7 Can you rerun the tests? |
| @@ -12490,13 +12490,15 @@ bool checkAddressVar(Scope* sc, Expression exp, VarDeclaration v) | |||
| v.storage_class &= ~STC.maybescope; | |||
| v.doNotInferScope = true; | |||
| if (exp.type.hasPointers() && v.storage_class & STC.scope_ && | |||
| !(v.storage_class & STC.temp) && | |||
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.
What's this for?
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.
Maybe a remnant of the old bug that caused enclosesLifetimeOf to return wrong results for VarDeclarations created during semantic?
|
Ping @WalterBright @RazvanN7 |
|
Looks like the problem is in phobos: |
So the error is still there. I thought it would be fixed by dlang/phobos#8119 |
|
Removing auto merge this has failures all across build kite |
…y should be error
|
The buildkite failures were in projects not using dip1000, so I added an |
…y should be error