aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/backend/jvm/DottyBackendInterface.scala
diff options
context:
space:
mode:
authorDmitry Petrashko <dmitry.petrashko@gmail.com>2015-05-06 17:03:33 +0200
committerDmitry Petrashko <dmitry.petrashko@gmail.com>2015-05-08 13:33:51 +0200
commitff091be1075911d5979d7b34ebcec7153eb5486e (patch)
tree8b24b9031253f45c39d848f0eeb0a69775107dbb /src/dotty/tools/backend/jvm/DottyBackendInterface.scala
parent1838eb04314f30afd74d7ce1bce61ff08989786b (diff)
downloaddotty-ff091be1075911d5979d7b34ebcec7153eb5486e.tar.gz
dotty-ff091be1075911d5979d7b34ebcec7153eb5486e.tar.bz2
dotty-ff091be1075911d5979d7b34ebcec7153eb5486e.zip
Workaround dotty deviation in for loop patterns.
Diffstat (limited to 'src/dotty/tools/backend/jvm/DottyBackendInterface.scala')
-rw-r--r--src/dotty/tools/backend/jvm/DottyBackendInterface.scala15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/dotty/tools/backend/jvm/DottyBackendInterface.scala b/src/dotty/tools/backend/jvm/DottyBackendInterface.scala
index 1f70e1bd3..7795f3b95 100644
--- a/src/dotty/tools/backend/jvm/DottyBackendInterface.scala
+++ b/src/dotty/tools/backend/jvm/DottyBackendInterface.scala
@@ -308,8 +308,12 @@ class DottyBackendInterface()(implicit ctx: Context) extends BackendInterface{
private def emitAssocs(av: asm.AnnotationVisitor, assocs: List[(Name, Object)], bcodeStore: BCodeHelpers)
(innerClasesStore: bcodeStore.BCInnerClassGen) = {
- for ((name, value) <- assocs) {
- emitArgument(av, name.toString(), value.asInstanceOf[Tree], bcodeStore)(innerClasesStore)
+ //for ((name, value) <- assocs) { // dotty deviation, does not work
+
+ for (nv <- assocs) {
+ val name = nv._1
+ val value = nv._2
+ emitArgument(av, name.toString, value.asInstanceOf[Tree], bcodeStore)(innerClasesStore)
}
av.visitEnd()
}
@@ -802,7 +806,8 @@ class DottyBackendInterface()(implicit ctx: Context) extends BackendInterface{
def primitiveOrClassToBType(sym: Symbol): BType = {
assert(sym.isClass, sym)
assert(sym != ArrayClass || isCompilingArray, sym)
- primitiveTypeMap.getOrElse(sym, storage.getClassBTypeAndRegisterInnerClass(sym.asInstanceOf[ct.int.Symbol]))
+ primitiveTypeMap.getOrElse(sym.asInstanceOf[ct.bTypes.coreBTypes.bTypes.int.Symbol],
+ storage.getClassBTypeAndRegisterInnerClass(sym.asInstanceOf[ct.int.Symbol])).asInstanceOf[BType]
}
/**
@@ -811,7 +816,7 @@ class DottyBackendInterface()(implicit ctx: Context) extends BackendInterface{
*/
def nonClassTypeRefToBType(sym: Symbol): ClassBType = {
assert(sym.isType && isCompilingArray, sym)
- ObjectReference
+ ObjectReference.asInstanceOf[ct.bTypes.ClassBType]
}
tp.widenDealias match {
@@ -856,7 +861,7 @@ class DottyBackendInterface()(implicit ctx: Context) extends BackendInterface{
"If possible, please file a bug on issues.scala-lang.org.")
tp match {
- case ThisType(ArrayClass) => ObjectReference // was introduced in 9b17332f11 to fix SI-999, but this code is not reached in its test, or any other test
+ case ThisType(ArrayClass) => ObjectReference.asInstanceOf[ct.bTypes.ClassBType] // was introduced in 9b17332f11 to fix SI-999, but this code is not reached in its test, or any other test
case ThisType(sym) => storage.getClassBTypeAndRegisterInnerClass(sym.asInstanceOf[ct.int.Symbol])
// case t: SingletonType => primitiveOrClassToBType(t.classSymbol)
case t: SingletonType => t.underlying.toTypeKind(ct)(storage)