[Issue 8629] New: UFCS resolution prints fake error

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Sep 8 00:07:35 PDT 2012


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

           Summary: UFCS resolution prints fake error
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: diagnostic
          Severity: trivial
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: k.hara.pg at gmail.com


--- Comment #0 from Kenji Hara <k.hara.pg at gmail.com> 2012-09-08 00:08:15 PDT ---
Following code compilation fails with -property switch.
----
struct S {}

auto gunc(S s, int n) { return 13; }
@property grop(S s, int n) { return 14; }

void main()
{
    S s;
    assert((s.gunc = 1) == 13);     // line 9
    assert((s.grop = 1) == 14);     // line 10
}

output:
----
test.d(9): Error: not a property s.gunc
test.d(10): Error: function test.grop (S s, int n) is not callable using
argument types (S)
test.d(10): Error: expected 2 function arguments, not 1
----

But if you comment out line 9, you can succeed to compile.
Then, the line 10 error for the code is *fake*.

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


More information about the Digitalmars-d-bugs mailing list