[Issue 2091] New: D2 final cannot be applied to variable

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat May 10 05:26:59 PDT 2008


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

           Summary: D2 final cannot be applied to variable
           Product: D
           Version: 2.013
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: gide at nwawudu.com


The following code compiles on D1 but fails on D2. I think 'final:' is being
applied to the whole class.

test.d
------
class Bar { }

class Foo {
  final:
    this() {}
    Bar getBar() {
      return b;
    }
  private:
    Bar b;      
}

void main() {
}

c:\> dmd test.d
test.d(11): variable c.Foo.b final cannot be applied to variable


-- 



More information about the Digitalmars-d-bugs mailing list