[Issue 12242] conflict error with public imports
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Wed May 14 06:40:03 PDT 2014
https://issues.dlang.org/show_bug.cgi?id=12242
--- Comment #7 from Kenji Hara <k.hara.pg at gmail.com> ---
One more test case of this issue:
module test01;
private mixin template MixTmp(T, int x)
{
template foo(U) if (is(U == T))
{
enum foo = x;
}
}
mixin MixTmp!(int, 1);
mixin MixTmp!(long, 2);
------------
module test02;
private mixin template MixTmp(T, int x)
{
template foo(U) if (is(U == T))
{
enum foo = x;
}
}
mixin MixTmp!(float, 3);
mixin MixTmp!(real, 4);
------------
import test01, test02;
import std.stdio;
void main()
{
writeln( foo!int );
}
In module test01 and test02, 'foo' make individual overload sets. And in module
test03, the imported two overload sets 'foo' should be merged to a new overload
set 'foo' which contains four mixed-in templates.
--
More information about the Digitalmars-d-bugs
mailing list