www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 10974] New: static or enum a=expr different from auto a=expr ;

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10974

           Summary: static or enum a=expr different from auto a=expr ;
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: blocker
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: thelastmammoth gmail.com


--- Comment #0 from thelastmammoth gmail.com 2013-09-05 15:00:29 PDT ---
struct A{
  bool bar=true;
}

auto fun(){
  A a;

  auto ptr=&a.bar;
  *ptr=false;

  //a.bar=false; //would work

  return a;
}

void main(){
  A option2=fun;
  assert(!option2.bar);

  static A option1=fun;
  assert(!option1.bar);//fails

  enum option3=fun;
  assert(!option3.bar);//fails
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Sep 05 2013
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10974


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrej.mitrovich gmail.com


--- Comment #1 from Andrej Mitrovic <andrej.mitrovich gmail.com> 2013-09-05
15:01:31 PDT ---
Confirmed in 2.063.2, however in git-head this code works.

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