inheriting statics

Peter Hall peterjoel at gmail.com
Tue Jan 9 08:15:43 PST 2007


>
> In other words, statics are inherited and can be redefined, although
> they are statically resolved, so they have shadowing semantics (like
> instance fields) rather than overriding.
>


So there does not even need to be a requirement that the type of
static variables be related to the type of the variable in the
super-class, or for static method signatures to match.

But I'm wondering..

class A {
 public static function foo (){
 }
}

class B extends A {
   // should this non-static method be allowed?
   public function foo(){
       // and, if so, can I do this?
       super.foo();
   }
}

class C extends B {
  public static function foo(){
      // and, if so, would this invoke A.foo or be an error?
      super.foo();
  }
}


Peter



More information about the Es4-discuss mailing list