Consider the following MiniJava test:

module strange

language minijava
start symbol Program

test call method in first subclass [[
class Main {
  public static void main(String[] args) {
    System.out.println(1);
  }
}

class A {

    public int a() {
        return 42;
    }
}

class B extends A {
    public int [[a]]() {
        return 10;
    }
}

class C extends B {
    public int b() {
        return this.[[a]]();
    }
}
]] resolve #2 to #1

This should succeed for a correct MiniJava implementation. And the program does resolve that way in a separate file. But the SPT test fails, it instead resolves a to the method in class A.

Submitted by Jeff Smits on 29 November 2017 at 13:54

Log in to post comments