Skip to content

Conversation

monarchdodra
Copy link
Collaborator

https://issues.dlang.org/show_bug.cgi?id=13304

Also cover test case 10709.
https://issues.dlang.org/show_bug.cgi?id=10709

Truth be told, I'm not yet entirely sure what went wrong, and why this fixes the issue. It seems that the compiler was trying to actually CTFE-evaluate the fun call in s = fun(s, e);, whereas the is(typeof(s = fun(s, e)) merely checks the semantics are correct.

I'm still trying to reduce the actual cause, but in the mean time, this (should) fix a regression.

@monarchdodra
Copy link
Collaborator Author

Groan... why is the compiler trying to link in a function that never gets called?

@monarchdodra
Copy link
Collaborator Author

I deactivated the unittest that is causing the failure (the test itself works, but creates a link error). I'll have to try to reduce and submit.

@quickfur
Copy link
Member

Should we wait until you've finished reducing it?

@mihails-strasuns
Copy link

I think we should

@monarchdodra
Copy link
Collaborator Author

I think we should

Well, it is a regression, so faster is better. What's more, it seems relatively easy to trigger.

Furthermore, the code that's failing is merely there trying to give a good diagnostic eagerly, rather than an obscure one in internal later. If worst comes to worst, we could just strip it out entirely.

I'll have some time Friday to see what I can do.

@mihails-strasuns
Copy link

If it has resulted in immediate unittest failure how likely it is that it will just create another regression with some of the user code out there? Quite likely in my opinion.

Also cover test case 10709.
@monarchdodra
Copy link
Collaborator Author

Failure actually had nothing to do with my code:

auto red()()
{
    return foo();
}

static int foo();

void main(string[] args)
{
    int[] data;
    assert(is(typeof(red()))); //Temporarilly disabled.
}

I just removed the unittest then. Should be fine now.

@monarchdodra
Copy link
Collaborator Author

@mihails-strasuns
Copy link

ah must be yet another issues with speculative template instantiations
ok, lets go ahead with this one

@mihails-strasuns
Copy link

Auto-merge toggled on

mihails-strasuns pushed a commit that referenced this pull request Aug 21, 2014
Fix reduce regression 13304.
@mihails-strasuns mihails-strasuns merged commit bfebba8 into dlang:master Aug 21, 2014
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