SDK: 8.1.1
I'm guessing that the runtime behaviour is by design, and the type checker is wrong. (Same behaviour at levels 1, 2, and 3).
import Toybox.Lang;
import Toybox.System;
class A {
public static function doSomething() as Void {
System.println("A");
}
public static function doMore() as Void {
doSomething(); // *
// * This compiles fine but crashes at runtime
// "Error: Symbol Not Found Error
// Details: Could not find symbol 'doSomething'""
//
// Same thing happens with `self.doSomething()`, although
// type checker doesn't complain about either construct
//
// only A.doSomething() or B.doSomething() work at runtime
}
}
class B extends A {
function initialize() {
A.initialize();
}
public static function doSomething() as Void {
System.println("B");
}
}
class C {
public function doItAll() as Void {
B.doMore();
}
}
function test() as Void {
new C().doItAll();
}