Unjustified conflict ( I guess ^^ )

Unknown W. Brackets unknown at simplemachines.org
Wed Dec 19 01:57:46 PST 2007


The trouble is, they're not both functions or both templates, which is 
why it's giving you this.

In other words, it's more steps than you're imagining:

Step 1. Find the symbol (foo the template or foo the function?)

Step 2. If the symbol is a template, automatically deduce types (only 
after we've picked it.)

Step 3. Pick the best overload and make sure there's no conflicts.

If it were two steps, where it deduces types for all possible templates, 
flattens them and compares all equally... then this would work.

As is, you'll have to use alias to make this work, or perhaps make them 
both use templates (though I'm not sure that will work.)

-[Unknown]


funog wrote:
> I have posted this one on digitalmars.D.bugs, but somehow I feel it wasn't the right place ... dmd1.023 ( can't try with 1.024 or 2.008 as I don't have glibc 2.4 ... it's really sad I can't try the new const/invariant :( ) doesn't compile :
> 
> 
> void foo(T)(out T[] p)
> {
>         //...
> }
> 
> void foo(out int p)
> {
>         //...
> }
> 
> 
> test.d(7): function test.foo conflicts with template test.foo(T) at test.d(2)
> 
> 
> I can't see a conflict ... Am I missing something ?



More information about the Digitalmars-d mailing list