> Does this mean you can't write > > class Super { method something { ... } } > > sub foo (Super $bar) { $bar.something() } > > and expect foo($obj) to work, because $obj might be: > > class Sub is Super { # remove .something--how does that happen? } > > foo($obj); # Boom!? > > So what happens?
For the case in point if you tried to call @array.set(0, $element) I would expect it to fail with an error saying you can't modify a constant array. The method set still exists - it just politely tells you not to call that method on that particular class. No methods are removed. This is very similar to read only strings. Paul Seamons