Summary: When a class with the same name as a module exists
                    within that module and has static members, you're
                    required to do modulename.classname.member() in order
                    to access said members
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD

--- Comment #0 from Trey Brisbane <> 2012-06-23 03:24:09 
PDT ---
Pretty much exactly what the summary says. Here is an example:

File 1:
module objectA;

class objectA {
  public static void doSomething() {

File 2:
module main;

import objectA;

int main(string[] args) {
  objectA.doSomething(); // Error: undefined identifier 'doSomething'
  objectA.objectA.doSomething(); // Ok
  return 0;

Obviously, the compiler is searching for a function called doSomething in the
module objectA, when it should instead recognize that a class called objectA
has been imported and an attempt is being made to access its static member

Please note that this is my first bug submission, so if it's already known (I
did search before posting this) or has a simple fix, please forgive me. :)

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to