Don <> changed:

           What    |Removed                     |Added
           Keywords|spec                        |patch
                 CC|                            |

--- Comment #9 from Don <>  2009-07-20 23:58:17 PDT ---

This is fixed in DMD2, and the main part of the code (with error message)
is in the DMD1 source, but not enabled (it won't compile). So it seems Walter
got halfway through fixing this, then got distracted?
(I'm removing 'spec' from the keywords, since it's clear this is just a bug).
Doing a copy-and-paste of the uniqueness test from D2, and disabling the
overload test, it _seems_ to work.
I'm assuming that the 'hasOverloads' member in D2 is for overload sets? In any
case, with this change, the D1 compiler passes the DM test suite, and the
phobos1 unit tests. Of course, if that member isn't for overload sets, this
patch isn't correct, regardless of what the tests say...
(In that case, the code relating to 'hasOverloads' should also be copied from

>From D2, in expression.c, in
Type *ExpInitializer::inferType(Scope *sc),
enable the code inside #if DMDV2.
But change the line:
    if (se->hasOverloads && !se->var->isFuncDeclaration()->isUnique())
    if (!se->var->isFuncDeclaration()->isUnique()) 

And then in func.c, add this code from DMD2.

static int fpunique(void *param, FuncDeclaration *f)
{   FuncDeclaration **pf = (FuncDeclaration **)param;

    if (*pf)
    {    *pf = NULL;
    return 1;        // ambiguous, done
    {    *pf = f;
    return 0;

FuncDeclaration *FuncDeclaration::isUnique()
{   FuncDeclaration *result = NULL;

    overloadApply(this, &fpunique, &result);
    return result;

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to