scala / bug

Scala 2 bug reports only. Please, no questions — proper bug reports only.
https://scala-lang.org
232 stars 21 forks source link

Java pasted source can't use REPL artifacts #13059

Open som-snytt opened 2 weeks ago

som-snytt commented 2 weeks ago

Reproduction steps

Scala version: 2.13.15

scala> :pa -java
// Entering paste mode (ctrl-D to finish)

package p;
public class X {
}

// Exiting paste mode... now compiling with javac.

scala> class Y extends p.X
class Y

scala> :pa
// Entering paste mode (ctrl-D to finish)

package p
class Z extends X

// Exiting paste mode... now compiling with scalac.

but I can't test Java interop from the Java side.

scala> :pa -java
// Entering paste mode (ctrl-D to finish)

package p;
public class W extends Z {
}

// Exiting paste mode... now compiling with javac.
Compilation failed! cannot find symbol
  symbol: class Z

Problem

Testing interop is the point of the feature.