http://d.puremagic.com/issues/show_bug.cgi?id=4217


Shin Fujishiro <rsi...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #641 is|0                           |1
           obsolete|                            |


--- Comment #3 from Shin Fujishiro <rsi...@gmail.com> 2010-09-21 11:16:09 PDT 
---
Created an attachment (id=762)
Patch against dmd r680, implements FuncDeclaration::equals()

Updated patch and a cleaned up test case.
-------------------- test.d
template Return(alias fun)
{
    static if (is(typeof(fun) R == return)) alias R Return;
}

interface I
{
    int  square(int  n);
    real square(real n);
}
alias Return!( __traits(getOverloads, I, "square")[0] ) R0;
alias Return!( __traits(getOverloads, I, "square")[1] ) R1;

static assert(! is(R0 == R1)); // (14)
--------------------
% dmd -o- -c test.d
test.d(14): Error: static assert  (!true) is false
--------------------

The problem is that template alias (symbol) parameters are matched in terms of
the identifier via Dsymbol::equals().  The new patch implements
FuncDeclaration::equals() that checks for function type.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to