Created
September 11, 2024 10:13
-
-
Save xuwei-k/853319c7c9daa8b38888aca086daa34a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package x; | |
class A { | |
public int a() { return 2; } | |
} | |
public class B extends A{} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
scalaVersion := "3.5.1-RC2" | |
run / fork := true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[info] running (fork) y.Main | |
[error] Exception in thread "main" java.lang.IllegalAccessError: failed to access class x.A from class y.C (x.A and y.C are in unnamed module of loader 'app') | |
[error] at y.C.c(Main.scala:4) | |
[error] at y.Main$.main(Main.scala:9) | |
[error] at y.Main.main(Main.scala) | |
[error] Nonzero exit code returned from runner: 1 | |
[error] (Compile / run) Nonzero exit code returned from runner: 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package y; | |
class C extends x.B { | |
def c: Int = super.a | |
} | |
object Main { | |
def main(args: Array[String]): Unit = { | |
println((new C).c) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment