Skip to content
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 17388 - [scope] e[] should be treated like &e as far as sco… #7076

Merged
merged 1 commit into from
Aug 10, 2017

Conversation

WalterBright
Copy link
Member

…pe goes

&e was working correctly, so the fix was to make slicing a static array follow the same logic.

Had to make checkAddressVar() a global function so it can be called by both AddrExp and SliceExp.

@dlang-bot
Copy link
Contributor

Thanks for your pull request, @WalterBright!

Bugzilla references

Auto-close Bugzilla Description
17388 [scope] e[] should be treated like &e as far as scope goes

⚠️⚠️⚠️ Warnings ⚠️⚠️⚠️

@@ -3267,6 +3267,9 @@ private extern (C++) final class ExpressionSemanticVisitor : Visitor
}
if (exp.e1.op == TOKslice || exp.e1.type.ty == Tarray || exp.e1.type.ty == Tsarray)
{
if (exp.e1.op == TOKslice)
(cast(SliceExp)exp.e1).arrayop = true;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hope we can remove that special case once the library arrayOps story is merged. Still need to make it scope safe though.

@WalterBright WalterBright deleted the fix17388 branch August 13, 2017 07:02
@MartinNowak
Copy link
Member

Looks like you forgot PowAssignExp @WalterBright.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants