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

           Summary: '=' does not give a boolean result
           Product: D
           Version: 2.022
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzi...@digitalmars.com
        ReportedBy: adolf.math...@googlemail.com


Using a boolean assignment in an if condition e.g. as follows gives IMHO an
unjustified error message. When a new variable is declared in the if()
condition, everything is OK:

// tst.d
void main()
{ bool b;

  if(b=false) { b = true; }
  if(bool c=false) { c = true; }
}

$ dmd tst
tst.d(4): Error: '=' does not give a boolean result


-- 

Reply via email to