Skip to content

Commit

Permalink
Merge pull request #9422 from dotty-staging/fix-sbt-ctx
Browse files Browse the repository at this point in the history
Fix sbt scripted tests after refactor in #9343
  • Loading branch information
anatoliykmetyuk authored Jul 23, 2020
2 parents 5f73987 + 0d3c674 commit eb3b0ac
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
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
}
}
}

0 comments on commit eb3b0ac

Please sign in to comment.