Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import scala.language.implicitConversions

import dotty.tools.dotc._
import core._
import Symbols._
import Contexts.Context
import plugins._
import Phases.Phase
Expand Down Expand Up @@ -45,8 +46,8 @@ class InitChecker extends PluginPhase {
private def checkRef(tree: Tree)(implicit ctx: Context): Tree =
if (!checkable(tree.symbol)) tree
else {
val helloPkgSym = ctx.requiredPackage("hello").moduleClass
val libPkgSym = ctx.requiredPackage("lib").moduleClass
val helloPkgSym = requiredPackage("hello").moduleClass
val libPkgSym = requiredPackage("lib").moduleClass
val enclosingPkg = tree.symbol.enclosingPackageClass

if (enclosingPkg == helloPkgSym) { // source code
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import Phases.Phase
import ast.tpd
import transform.MegaPhase.MiniPhase
import Decorators._
import Symbols.Symbol
import Symbols._
import Constants.Constant
import transform.{Pickler, Staging}

Expand All @@ -26,7 +26,7 @@ class DivideZero extends PluginPhase with StandardPlugin {

private def isNumericDivide(sym: Symbol)(implicit ctx: Context): Boolean = {
def test(tpe: String): Boolean =
(sym.owner eq ctx.requiredClass(tpe)) && sym.name.show == "/"
(sym.owner eq requiredClass(tpe)) && sym.name.show == "/"

test("scala.Int") || test("scala.Long") || test("scala.Short") || test("scala.Float") || test("scala.Double")
}
Expand All @@ -38,4 +38,4 @@ class DivideZero extends PluginPhase with StandardPlugin {
case _ =>
tree
}
}
}