leibnitz27 / cfr

This is the public repository for the CFR Java decompiler
https://www.benf.org/other/cfr
MIT License
1.94k stars 249 forks source link

Creating instance of non-static inner class #241

Open Kyuuhachi opened 3 years ago

Kyuuhachi commented 3 years ago

CFR version 0.151, javac version 1.8.0_282

The decompiled output isn't valid. Relevant javac code is here. (Actually I didn't even know this was valid syntax until I started digging through javac's code to understand #237)

Example

class Test5 {
    class B {}
}
class Test5s {
    void test5() {
        new Test5().new B();
    }
}

Decompiles into

class Test5s {
    Test5s() {
    }

    void test5() {
        new Test5.B(new Test5());
    }
}