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 2156 - [] and null should be accepted where a compile-time string is required #180

Closed
wants to merge 1 commit into from

Conversation

yebblies
Copy link
Member

Issue 2156 - [] and null should be accepted where a compile-time string is required

Instead of checking for TOKstring, use toString to check if a string, array literal or null literal can be used.

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

…ng is required

Instead of checking for TOKstring, use toString to check if a string, array literal or null literal can be used.

if (telem == Tchar || telem == Twchar || telem == Tdchar)
{
Expression *e = castTo(sc, Type::tstring)->interpret(NULL);
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should be done as optimize(WANTvalue | WANTinterpret), rather than a direct call to interpret(). But, it's already been interpreted,* so the whole thing is unnecessary. If any element of the array is anything other than TOKint64, it's not convertible to string.

  • except the GNU_asm pragma. This should be changed.

@yebblies
Copy link
Member Author

yebblies commented Sep 2, 2011

Superseded by pull #362.

@yebblies yebblies closed this Sep 2, 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.

2 participants