You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
% tail test/files/run/som/*.{java,scala}
==> test/files/run/som/Java_1.java <==
public class Java_1<K, V> {
public class Inner extends Java_1<K, V> {
}
}
class SomeOtherJava {
}
==> test/files/run/som/Macros_1.scala <==
def fImpl(c: Context): c.Tree = {
import c.universe._
import reflect.runtime.{universe => ru}
val formatterSym = c.universe.symbolOf[bakery.SomeOtherJava]
ru.internal.createImporter(c.universe).importSymbol(formatterSym)
q"()"
}
}
==> test/files/run/som/Test_2.scala <==
object Test {
bakery.Bakery.f
}
% javac -d /tmp test/files/run/som/*.java && qscalac -classpath /tmp -d /tmp test/files/run/som/Macros_1.scala && qscalac -classpath /tmp -d /tmp test/files/run/som/Test_2.scala
error: error while loading Java_1$Inner, class file '/tmp/bakery/Java_1$Inner.class' is broken
(class java.util.NoSuchElementException/key not found: K)
one error found
% tail sandbox/{Java_1.java,test.scala}
==> sandbox/Java_1.java <==
public class Java_1<K, V> {
public class Inner extends Java_1<K, V> {
}
}
==> sandbox/test.scala <==
object Test {
classOf[Java_1$Inner]
}
% javac -d /tmp sandbox/Java_1.java && qscalac -classpath /tmp sandbox/test.scala
error: error while loading Java_1$Inner, class file '/tmp/Java_1$Inner.class' is broken
(class java.util.NoSuchElementException/key not found: K)
sandbox/test.scala:2: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
classOf[Java_1$Inner]
^
one warning found
one error found
perhaps a .hasCompleteInfo check is missing somewhere? I hit this error in a closed-source compiler plugin, in reference to Hashtable.Entry in the Java stdlib. Adding such a check (as suggested by @adriaanm) fixed it.
As reported and discussed https://groups.google.com/d/msg/scala-internals/p3LUQSniAl8/2GB1ok9SK2MJ
The text was updated successfully, but these errors were encountered: