New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fsc crashes every other time on inner Java enums #6613
Comments
Imported From: https://issues.scala-lang.org/browse/SI-6613?orig=1 |
jhodkinson said (edited by @JamesIry on Feb 1, 2013 6:00:13 AM UTC): Here's my output: last tree to typer: Literal(Constant(com.aa.bb.cc.xjc.XJCRuntimeCompiler))
symbol: null
symbol definition: null
tpe: Class(classOf[com.aa.bb.cc.xjc.XJCRuntimeCompiler])
symbol owners:
context owners: class XJCRuntimeCompiler$LoggerErrorReceiverImpl -> package xjc
== Enclosing template or block ==
Template( // val <local LoggerErrorReceiverImpl>: <notype> in class XJCRuntimeCompiler$LoggerErrorReceiverImpl, tree.tpe=com.aa.bb.cc.xjc.XJCRuntimeCompiler$LoggerErrorReceiverImpl
"com.sun.tools.xjc.ErrorReceiver" // parents
ValDef(
private
"_"
<tpt>
<empty>
)
// 5 statements
DefDef( // def error(ex: org.xml.sax.SAXParseException): Unit in class XJCRuntimeCompiler$LoggerErrorReceiverImpl
<method>
"error"
[]
// 1 parameter list
ValDef( // ex: org.xml.sax.SAXParseException
<param> <triedcooking>
"ex"
<tpt> // tree.tpe=org.xml.sax.SAXParseException
<empty>
)
<tpt> // tree.tpe=Unit
Apply( // def warn(x$1: String,x$2: Throwable): Unit in trait Logger, tree.tpe=Unit
XJCRuntimeCompiler.this.logger()."warn" // def warn(x$1: String,x$2: Throwable): Unit in trait Logger, tree.tpe=(x$1: String, x$2: Throwable)Unit
// 2 arguments
"Compile error "
"ex" // ex: org.xml.sax.SAXParseException, tree.tpe=org.xml.sax.SAXParseException
)
)
DefDef( // def fatalError(ex: org.xml.sax.SAXParseException): Unit in class XJCRuntimeCompiler$LoggerErrorReceiverImpl
<method>
"fatalError"
[]
// 1 parameter list
ValDef( // ex: org.xml.sax.SAXParseException
<param> <triedcooking>
"ex"
<tpt> // tree.tpe=org.xml.sax.SAXParseException
<empty>
)
<tpt> // tree.tpe=Unit
Apply( // def warn(x$1: String,x$2: Throwable): Unit in trait Logger, tree.tpe=Unit
XJCRuntimeCompiler.this.logger()."warn" // def warn(x$1: String,x$2: Throwable): Unit in trait Logger, tree.tpe=(x$1: String, x$2: Throwable)Unit
// 2 arguments
"Compile fatal "
"ex" // ex: org.xml.sax.SAXParseException, tree.tpe=org.xml.sax.SAXParseException
)
)
DefDef( // def warning(ex: org.xml.sax.SAXParseException): Unit in class XJCRuntimeCompiler$LoggerErrorReceiverImpl
<method>
"warning"
[]
// 1 parameter list
ValDef( // ex: org.xml.sax.SAXParseException
<param> <triedcooking>
"ex"
<tpt> // tree.tpe=org.xml.sax.SAXParseException
<empty>
)
<tpt> // tree.tpe=Unit
Apply( // def warn(x$1: String,x$2: Throwable): Unit in trait Logger, tree.tpe=Unit
XJCRuntimeCompiler.this.logger()."warn" // def warn(x$1: String,x$2: Throwable): Unit in trait Logger, tree.tpe=(x$1: String, x$2: Throwable)Unit
// 2 arguments
"Compile warning "
"ex" // ex: org.xml.sax.SAXParseException, tree.tpe=org.xml.sax.SAXParseException
)
)
DefDef( // def info(ex: org.xml.sax.SAXParseException): Unit in class XJCRuntimeCompiler$LoggerErrorReceiverImpl
<method>
"info"
[]
// 1 parameter list
ValDef( // ex: org.xml.sax.SAXParseException
<param> <triedcooking>
"ex"
<tpt> // tree.tpe=org.xml.sax.SAXParseException
<empty>
)
<tpt> // tree.tpe=Unit
Apply( // def warn(x$1: String,x$2: Throwable): Unit in trait Logger, tree.tpe=Unit
XJCRuntimeCompiler.this.logger()."warn" // def warn(x$1: String,x$2: Throwable): Unit in trait Logger, tree.tpe=(x$1: String, x$2: Throwable)Unit
// 2 arguments
"Compile info "
"ex" // ex: org.xml.sax.SAXParseException, tree.tpe=org.xml.sax.SAXParseException
)
)
DefDef( // def <init>(): com.aa.bb.cc.xjc.XJCRuntimeCompiler$LoggerErrorReceiverImpl in class XJCRuntimeCompiler$LoggerErrorReceiverImpl
<method> <triedcooking>
"<init>"
[]
List(Nil)
<tpt> // tree.tpe=com.aa.bb.cc.xjc.XJCRuntimeCompiler$LoggerErrorReceiverImpl
Block( // tree.tpe=Unit
Apply( // def <init>(): com.sun.tools.xjc.ErrorReceiver in class ErrorReceiver, tree.tpe=com.sun.tools.xjc.ErrorReceiver
XJCRuntimeCompiler$LoggerErrorReceiverImpl.super."<init>" // def <init>(): com.sun.tools.xjc.ErrorReceiver in class ErrorReceiver, tree.tpe=()
com.sun.tools.xjc.ErrorReceiver
Nil
)
()
)
)
)
== Expanded type of tree ==
ConstantType(
value = Constant(com.aa.bb.cc.xjc.XJCRuntimeCompiler)
)
how can getCommonSuperclass() do its job if different class symbols get the same bytecode-level internal name: scala/Enumeration$Value); see the error output for details. |
@JamesIry said: On either path we get to this point [[syntax trees at end of constructors]] // Test.scala
package <empty>{type} {
class test extends Object {
def foo(): Unit = {
val x: Broke.Breakage = CHIP{Broke.Breakage(CHIP)};
(){Unit}
}{Unit};
}
} Then, when it works we get [[syntax trees at end of flatten]] // Test.scala
package <empty>{type} {
class test extends Object {
def foo(): Unit = {
val x: Broke$Breakage = CHIP{Broke$Breakage(CHIP)};
(){Unit}
}{Unit};
}
} However, when it doesn't work we get [[syntax trees at end of flatten]] // Test.scala
package <empty>{type} {
class test extends Object {
def foo(): Unit = {
val x: Broke$Breakage = CHIP{<notype>(CHIP)};
(){Unit}
}{Unit};
}
} |
@retronym said: |
@paulp said: scala
Welcome to Scala version 2.11.2 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_11).
Type in expressions to have them evaluated.
Type :help for more information.
scala> J.Broke.SHARD
res0: J.Broke = SHARD
scala> J.Broke.SHARD
ReplGlobal.abort: Unknown type: <notype>(SHARD), <notype> [class scala.reflect.internal.Types$UniqueConstantType, class scala.reflect.internal.Types$NoType$] TypeRef? false
error: Unknown type: <notype>(SHARD), <notype> [class scala.reflect.internal.Types$UniqueConstantType, class scala.reflect.internal.Types$NoType$] TypeRef? false
scala.reflect.internal.FatalError: Unknown type: <notype>(SHARD), <notype> [class scala.reflect.internal.Types$UniqueConstantType, class scala.reflect.internal.Types$NoType$] TypeRef? false
at scala.reflect.internal.Reporting$class.abort(Reporting.scala:59)
at scala.tools.nsc.interpreter.IMain$$anon$1.scala$tools$nsc$interpreter$ReplGlobal$$super$abort(IMain.scala:237)
at scala.tools.nsc.interpreter.ReplGlobal$class.abort(ReplGlobal.scala:20)
at scala.tools.nsc.interpreter.IMain$$anon$1.abort(IMain.scala:237)
at scala.tools.nsc.backend.icode.TypeKinds$class.toTypeKind(TypeKinds.scala:401)
at scala.tools.nsc.backend.icode.ICodes.toTypeKind(ICodes.scala:19)
at scala.tools.nsc.backend.icode.GenICode$ICodePhase.genLoadLiteral$1(GenICode.scala:907)
at scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:911)
at scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase |
@lrytz said: |
@lrytz said: |
fsc fails with a
notype
error every other time (first compilation succeeds, next one fails, next succeeds, next fails, etc.) when referring to a public enum declared inside a Java class.The error can be reproduced with the following code. Breaking.java:
Broken.scala:
And to demonstrate the problem:
or
scalac -Xresident
withBroken.scala
entered twice.The 20121101 nightly is still broken. MC3 worked. 20120918 breaks on the same code, but has a complaint (again, only on the second try; in -Xresident mode) not present in later builds:
Not sure if this is related to the reflection bug on enums (this one), but this one is more serious as it randomly cripples builds if
fsc
is used.The text was updated successfully, but these errors were encountered: