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

           Summary: You can not create the function returns ref instead of
                    statement
           Product: D
           Version: 2.021
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzi...@digitalmars.com
        ReportedBy: resume...@mail.ru


this code causes the error:

void main()
{
    int i;

    ref int func()
    {
      return i;
    }

    func() = 4;
}

lval.d(5): found 'ref' instead of statement
lval.d(10): no identifier for declarator func
lval.d(11): unrecognized declaration


but code like this compiles:

ref int func()
{
  int* i = new int;
  return *i;
}

void main()
{
    func() = 4;
}


-- 

Reply via email to