djrieger / mjplusplus

A compiler for the MiniJava language
http://djrieger.github.io/mjplusplus/doc/doxygen/html/
6 stars 1 forks source link

Semantic correct file: mj++ has problem with System.out.println #56

Closed ratefuchs closed 9 years ago

ratefuchs commented 9 years ago

When parsing the following file:+

class a {
    public static void main(String[] args) {}
}

class b {
    public void x() {
        System.out.println(1);
    }
}

mj++ -c gives the following error: Semantic error at line 7, column 3: b has no field named 'System'

When System.out.println is used within the first class in a file, however, it seems to work. Git bisect implies that the commit that gave rise to this bug is 2c6c22f.