Skip to content

the way access nested scala singleton from java code changes in JDK11 #12111

@docete

Description

@docete

reproduction steps

I have the following scala code (in scala 2.11.12)

package pkg1

object outer {
    object inner {
        def foo() = ???
    }
}

And the following java code to call function foo

package pkg2;

import pkg1.outer;

public class Test {
    public void bar() {
        outer.inner$.MODULE$.foo();
    }
}

for JDK8, it works. But for JDK11, the compiler complain "cannot find symbol inner$"

problem

I checked the class files and found the decompiled codes are exactly the same.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions