D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 7553 - auto template param triggers mixin conflict
Summary: auto template param triggers mixin conflict
Status: RESOLVED WORKSFORME
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-20 12:38 UTC by Ellery Newcomer
Modified: 2015-02-18 03:36 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Ellery Newcomer 2012-02-20 12:38:40 UTC
dmd 2.058

the code:

template Foo(){
    struct Range{
    }
}
template Biz(){
    struct Range{
    }
}

class Bar{
    mixin Foo!() index0;
    mixin Biz!() index1;
    auto to_range(Range)(Range r)
    {
    }

}

void main(){
    auto r2 =Bar.to_range(1);
}

the fireworks:

test.d(13): Error: test.Bar.Foo!().Range at test.d(2) conflicts with test.Bar.Biz!().Range at test.d(6)
Comment 1 hsteoh 2014-07-30 00:59:27 UTC
Seems to work in git HEAD, after fixing some errors in the code:
------
template Foo(){
    struct Range{
    }
}
template Biz(){
    struct Range{
    }
}

class Bar{
    mixin Foo!() index0;
    mixin Biz!() index1;
    auto to_range(Range)(Range r)
    {   
        return r; // have to return something for r2 to have non-void type
    }

}

void main(){
    auto r2 =Bar.init.to_range(1); // have to use .init to pass actual value to to_range
}
------

With these changes, it can compile successfully; no more conflict errors. So looks like the bug has been fixed in git HEAD.
Comment 2 github-bugzilla 2014-09-14 21:55:50 UTC
Commit pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/e93599f1d3a130435879e93e85abe4a1180a9a98
fix Issue 7553 - auto template param triggers mixin conflict
Comment 3 github-bugzilla 2015-02-18 03:36:53 UTC
Commit pushed to 2.067 at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/e93599f1d3a130435879e93e85abe4a1180a9a98
fix Issue 7553 - auto template param triggers mixin conflict