This file contains 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 a { | |
object X | |
package b { | |
object Y | |
} | |
} | |
package b { | |
object Z | |
} | |
object Main1 { | |
import a._ | |
import b._ | |
X | |
Y | |
Z // これだけ参照できない | |
} | |
object Main2 { | |
import b._ | |
import a._ | |
X | |
Y // これだけ参照できない | |
Z | |
} |
This file contains 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
$ scala --version | |
Scala code runner version 2.13.10 -- Copyright 2002-2022, LAMP/EPFL and Lightbend, Inc. | |
$ scalac a.scala | |
a.scala:19: error: not found: value Z | |
Z // これだけ参照できない | |
^ | |
a.scala:27: error: not found: value Y | |
Y // これだけ参照できない | |
^ | |
2 errors |
This file contains 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
$ scala --version | |
Scala code runner version 3.2.1 -- Copyright 2002-2022, LAMP/EPFL | |
$ scalac a.scala | |
-- [E006] Not Found Error: a.scala:19:2 ---------------------------------------- | |
19 | Z // これだけ参照できない | |
| ^ | |
| Not found: Z | |
| | |
| longer explanation available when compiling with `-explain` | |
-- [E006] Not Found Error: a.scala:27:2 ---------------------------------------- | |
27 | Y // これだけ参照できない | |
| ^ | |
| Not found: Y | |
| | |
| longer explanation available when compiling with `-explain` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment