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

Issue 4031 - Should be able to access const value-type globals from pure #194

Closed
wants to merge 1 commit into from

Conversation

yebblies
Copy link
Member

@yebblies yebblies commented Jul 2, 2011

Issue 4031 - Should be able to access const value-type globals from pure functions

Const value-type globals function the same as immutables, so allow them to be accessed from inside pure functions.

http://d.puremagic.com/issues/show_bug.cgi?id=4031

…ure functions

Const value-type globals function the same as immutables, so allow them to be accessed from inside pure functions.
@donc
Copy link
Collaborator

donc commented Jul 3, 2011

Does this also fix bug 6169? "[CTFE] pure functions cannot compute constants using functions not marked as pure"
http://d.puremagic.com/issues/show_bug.cgi?id=6169
Looks as though it might.

@WalterBright
Copy link
Member

Close, but I had to fix. b135734

@yebblies
Copy link
Member Author

yebblies commented Jul 4, 2011

No, it doesn't fix 6169.

Walter, your version of this fix allows the following to compile:
int z;
const static int* x;

static this()
{
x = &z;
}

void main() pure
{
auto g = *x;
}
The correct fix is probably to include both the hasPointers and the isDataSeg check.

And again, is there something weird going on that prevents you from doing a normal merge and resolving the conflicts, rather than creating a whole new commit?
Something like the following should work:

git pull git://github.com/yebblies/dmd.git branchname

then you edit to resolve the conflicts
git commit
git push origin

braddr pushed a commit to braddr/dmd that referenced this pull request Sep 15, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants