D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 9406 - (Regression: 2.061) Stack overflow from a forward reference error
Summary: (Regression: 2.061) Stack overflow from a forward reference error
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 regression
Assignee: No Owner
URL:
Keywords: ice, pull
Depends on:
Blocks:
 
Reported: 2013-01-26 15:08 UTC by Andrej Mitrovic
Modified: 2013-01-29 13:47 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Andrej Mitrovic 2013-01-26 15:08:31 UTC
Invalid code, accidentally reduced from Issue8785:

mixin template Mixin() { }

struct S
{
    template t1()
    {
        mixin Mixin t1;
    }
}

void main()
{
    S s1;
    s1.t1!();
}

2.060: 
$ dmd test.d
> test.d(7): Error: mixin test.S.t1().Mixin!() cannot resolve forward reference
> test.d(14): Error: expression has no value

2.061:
$ dmd test.d
> Stack overflow
Comment 1 Andrej Mitrovic 2013-01-26 15:10:22 UTC
(In reply to comment #0)
> Invalid code, accidentally reduced from Issue8785:

Actually I don't know whether it's invalid, but the stack overflow was found by accident.
Comment 3 Kenji Hara 2013-01-29 00:01:17 UTC
https://github.com/D-Programming-Language/dmd/pull/1576

(In reply to comment #0)
> 2.060: 
> $ dmd test.d
> > test.d(7): Error: mixin test.S.t1().Mixin!() cannot resolve forward reference
> > test.d(14): Error: expression has no value

In the code, there is no forward reference. So, the error "cannot resolve forward reference" is not correct.
Comment 4 github-bugzilla 2013-01-29 12:15:39 UTC
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/fb0aca7d5c7d103ea545574101355282edeba90b
fix Issue 9406 - (Regression: 2.061) Stack overflow from a forward reference error

https://github.com/D-Programming-Language/dmd/commit/6bb0a54cb8656c6debaac733118036ec3f48bbc6
Merge pull request #1576 from 9rnsr/fix9406

Issue 9406 - (Regression: 2.061) Stack overflow from a forward reference error