www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 12388] New: UFCS fails with "no property" error if symbol exists in scope

https://d.puremagic.com/issues/show_bug.cgi?id=12388

           Summary: UFCS fails with "no property" error if symbol exists
                    in scope
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: thecybershadow gmail.com


--- Comment #0 from Vladimir Panteleev <thecybershadow gmail.com> 2014-03-17
12:37:47 EET ---
//////// a.d ////////
struct S
{
    import b;

    void fun(int i)
    {
        "test".fun();
    }
}
//////// b.d ////////
void fun(string s) {}
/////////////////////

Compiler output:
a.d(7): Error: no property 'fun' for type 'string'

The code compiles if b.fun's name is changed to be different from a.S.fun's.

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