[Issue 5084] Static code does not ignore instance names during name lookup

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Jan 26 17:52:49 PST 2013


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


Andrej Mitrovic <andrej.mitrovich at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |andrej.mitrovich at gmail.com
         Resolution|                            |INVALID


--- Comment #1 from Andrej Mitrovic <andrej.mitrovich at gmail.com> 2013-01-26 17:52:46 PST ---
That would mean that an imported module which has a module-scoped variable or
property function with the same name as a non-static field could hijack that
field instead of giving you an error. It would be dangerous to allow such
behavior.

You can always use the dot prefix to lookup module-scoped variables, via
writeln(.x[2]).

-- 
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