#535 Can't initialize const fields in superclass

KevinKelley Wed 15 Apr 2009

We mentioned this before, in ref to It-blocks, but I want to get it on the list, because I keep wanting to do it.

class ViewPane : SashPane
{
  new make() { orientation = Orientation.vertical }
}

gives compile error:

Outliner.fan(63,26): Cannot set const field 'fwt::SashPane.orientation'

KevinKelley Wed 15 Apr 2009

Oops, shoulda updated first. That error is in 1.0.39; I hadn't updated to tip since then and now I see there's a bunch of good stuff for this. Never mind! :-)

KevinKelley Wed 15 Apr 2009

Updated to 1.41, Oh yeah, now I remember why I hadn't updated yet. Those two words breaking changes. :-) Boatloads of Unknown variable Thread and Ambiguous slot on this and it. Needed to figure out Actors anyway, and I think I heard that other one mentioned already, so I might understand that.

Anyhow, changed my above example to:

class ColumnPane : SashPane
{
  new make() 
  : super( |SashPane sp| { sp.orientation = Orientation.vertical } )
  {}
}

and I think it's gonna work. Now gotta go make all those changes.

Login or Signup to reply.