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

           Summary: Bogus diagnostic when member function call doesn't
                    match constancy
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: dmitry.o...@gmail.com


--- Comment #0 from Dmitry Olshansky <dmitry.o...@gmail.com> 2012-08-15 
10:56:08 PDT ---
It's an old and annoying bug. Could be a duplicate but I failed to find any.

Sample:

struct SimpleCaseEntry
{
    ubyte bucket;// n - number in bucket
    @property ubyte size()
    {
        return bucket & 0x3F;
    }
    @property auto isLower()
    {
        return bucket & 0x40;
    }
    @property auto isUpper()
    {
        return bucket & 0x80;
    }
    this(ubyte size, bool lower, bool upper)
    {
        bucket = size;
        if(lower)
            bucket |= 0x40;
        if(upper)
            bucket |= 0x80;

    }
}

void main()
{
    const SimpleCaseEntry e = SimpleCaseEntry(8, true, false);
    assert(!e.isUpper);
    assert(e.isLower);
}

With dmd 2.060:

D:\D\m.d(30): Error: function m.SimpleCaseEntry.isUpper () is not callable
using argument types()
D:\D\m.d(31): Error: function m.SimpleCaseEntry.isLower () is not callable
using argument types ()

Not a single word mentioning CONST or QUALIFIERS. While I'm more or less used
to wrong error message it would blow away newibie's mind and thus marked as
major.

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

Reply via email to