[Issue 18549] name gets overwritten in template definition

2018-03-11 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18549

Johannes Nordhoff  changed:

   What|Removed |Added

 Status|REOPENED|RESOLVED
 Resolution|--- |INVALID

--- Comment #3 from Johannes Nordhoff  ---
ah, sorry, i get it. sorry

--


[Issue 18549] name gets overwritten in template definition

2018-03-11 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18549

Johannes Nordhoff  changed:

   What|Removed |Added

 Status|RESOLVED|REOPENED
 Resolution|INVALID |---

--- Comment #2 from Johannes Nordhoff  ---
> > the compiler was using the same name for multiple
> > template-definitions.
>
> I don't understand what you mean by this. If you still think the compiler 
> should do something differently here, please feel free to reopen.
>

yeah, the error message should say:

sth.d(11): Error: sth.tmpl called with argument types () matches both:
sth.d(6): sth.tmpl!(SS).tmpl()
and:
sth.d(7): sth.tmpl!(tt).tmpl()


but instead it says:

sth.d(11): Error: sth.tmpl called with argument types () matches both:
sth.d(6): sth.tmpl!(SS).tmpl()
and:
sth.d(7): sth.tmpl!(SS).tmpl()


--


[Issue 18549] name gets overwritten in template definition

2018-03-04 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18549

ag0ae...@gmail.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||ag0ae...@gmail.com
 Resolution|--- |INVALID

--- Comment #1 from ag0ae...@gmail.com ---
(In reply to Johannes Nordhoff from comment #0)
> struct SS {}
> struct tt {}
> 
> void tmpl( SS)() {}
> void tmpl( tt)() {}

The template parameters SS and tt have no relation to the structs of the same
name. You could write it like this with the exact same meaning:


struct SS {}
struct tt {}

void tmpl(Foo)() {}
void tmpl(Bar)() {}


You've got two identical templates with the same name "tmpl". Any attempt at
instantiating tmpl will match both (or neither). The error messages you get
look fine to me.

I'm closing as INVALID, because it looks like you misunderstood how the
template parameter names relate to the struct names.

[...]
> the compiler was using the same name for multiple
> template-definitions.

I don't understand what you mean by this. If you still think the compiler
should do something differently here, please feel free to reopen.

--