aboutsummaryrefslogtreecommitdiff
path: root/compiler/src/dotty/tools/backend
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/src/dotty/tools/backend')
-rw-r--r--compiler/src/dotty/tools/backend/jvm/CollectEntryPoints.scala12
-rw-r--r--compiler/src/dotty/tools/backend/jvm/DottyBackendInterface.scala2
-rw-r--r--compiler/src/dotty/tools/backend/jvm/LabelDefs.scala1
3 files changed, 6 insertions, 9 deletions
diff --git a/compiler/src/dotty/tools/backend/jvm/CollectEntryPoints.scala b/compiler/src/dotty/tools/backend/jvm/CollectEntryPoints.scala
index 2ee1b6011..abcbbbb83 100644
--- a/compiler/src/dotty/tools/backend/jvm/CollectEntryPoints.scala
+++ b/compiler/src/dotty/tools/backend/jvm/CollectEntryPoints.scala
@@ -15,7 +15,6 @@ import java.io.{File => JFile}
import scala.collection.generic.Clearable
import scala.collection.mutable
import scala.reflect.ClassTag
-import scala.reflect.internal.util.WeakHashSet
import scala.reflect.io.{Directory, PlainDirectory, AbstractFile}
import scala.tools.asm.{ClassVisitor, FieldVisitor, MethodVisitor}
import scala.tools.nsc.backend.jvm.{BCodeHelpers, BackendInterface}
@@ -50,7 +49,7 @@ class CollectEntryPoints extends MiniPhaseTransform {
object CollectEntryPoints{
def isJavaMainMethod(sym: Symbol)(implicit ctx: Context) = {
(sym.name == nme.main) && (sym.info match {
- case r@MethodType(_, List(defn.ArrayOf(t))) =>
+ case r@MethodTpe(_, List(defn.ArrayOf(t)), _) =>
(t.widenDealias =:= defn.StringType) && (
r.resultType.widenDealias =:= defn.UnitType)
case _ => false
@@ -82,9 +81,8 @@ object CollectEntryPoints{
val possibles = if (sym.flags is Flags.Module) (toDenot(sym).info nonPrivateMember nme.main).alternatives else Nil
val hasApproximate = possibles exists { m =>
m.info match {
- case MethodType(_, p :: Nil) =>
- p.typeSymbol == defn.ArrayClass
- case _ => false
+ case MethodTpe(_, p :: Nil, _) => p.typeSymbol == defn.ArrayClass
+ case _ => false
}
}
// At this point it's a module with a main-looking method, so either succeed or warn that it isn't.
@@ -109,8 +107,8 @@ object CollectEntryPoints{
toDenot(m.symbol).info match {
case t: PolyType =>
fail("main methods cannot be generic.")
- case t@MethodType(paramNames, paramTypes) =>
- if (t.resultType :: paramTypes exists (_.typeSymbol.isAbstractType))
+ case MethodTpe(paramNames, paramTypes, resultType) =>
+ if (resultType :: paramTypes exists (_.typeSymbol.isAbstractType))
fail("main methods cannot refer to type parameters or abstract types.", m.symbol.pos)
else
isJavaMainMethod(m.symbol) || fail("main method must have exact signature (Array[String])Unit", m.symbol.pos)
diff --git a/compiler/src/dotty/tools/backend/jvm/DottyBackendInterface.scala b/compiler/src/dotty/tools/backend/jvm/DottyBackendInterface.scala
index 51fa15706..77e979e4d 100644
--- a/compiler/src/dotty/tools/backend/jvm/DottyBackendInterface.scala
+++ b/compiler/src/dotty/tools/backend/jvm/DottyBackendInterface.scala
@@ -531,7 +531,7 @@ class DottyBackendInterface(outputDirectory: AbstractFile, val superCallsMap: Ma
tree match {
case Apply(fun, args) =>
fun.tpe.widen match {
- case MethodType(names, _) =>
+ case MethodType(names) =>
names zip args
}
}
diff --git a/compiler/src/dotty/tools/backend/jvm/LabelDefs.scala b/compiler/src/dotty/tools/backend/jvm/LabelDefs.scala
index 654507991..1950d300d 100644
--- a/compiler/src/dotty/tools/backend/jvm/LabelDefs.scala
+++ b/compiler/src/dotty/tools/backend/jvm/LabelDefs.scala
@@ -16,7 +16,6 @@ import scala.collection.generic.Clearable
import scala.collection.mutable
import scala.collection.mutable.{ListBuffer, ArrayBuffer}
import scala.reflect.ClassTag
-import scala.reflect.internal.util.WeakHashSet
import scala.reflect.io.{Directory, PlainDirectory, AbstractFile}
import scala.tools.asm.{ClassVisitor, FieldVisitor, MethodVisitor}
import scala.tools.nsc.backend.jvm.{BCodeHelpers, BackendInterface}