[Issue 21558] New: UFCS doesn't play nice with hijacked default properties

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Jan 18 14:23:34 UTC 2021


https://issues.dlang.org/show_bug.cgi?id=21558

          Issue ID: 21558
           Summary: UFCS doesn't play nice with hijacked default
                    properties
           Product: D
           Version: D2
          Hardware: x86
                OS: Windows
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: rumbu at rumbu.ro

int sizeof(int a) { return 42; }
int nameof(int a) { return 99; }

int a;
int x = sizeof(a)    //42
int y = a.sizeof()   //Error: function expected before () ...
int z = a.sizeof     //4, but dangerous, maybe the user expects 42

int xx = nameof(a)    //99
int yy = a.nameof()   //Error: function expected before () ...
int zz = a.nameof     //Error: cannot implicitly ... string to int

--


More information about the Digitalmars-d-bugs mailing list