File tree Expand file tree Collapse file tree 3 files changed +10
-6
lines changed Expand file tree Collapse file tree 3 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import transform.MegaPhase.MiniPhase
88import Decorators ._
99import Symbols .Symbol
1010import Constants .Constant
11+ import StdNames ._
1112
1213class DivideZero extends MiniPhase with Plugin {
1314 val name : String = " divideZero"
@@ -24,9 +25,9 @@ class DivideZero extends MiniPhase with Plugin {
2425
2526 private def isNumericDivide (sym : Symbol )(implicit ctx : Context ): Boolean = {
2627 def test (tpe : String ): Boolean =
27- (sym.owner eq ctx.requiredClass(tpe.toTermName)) && sym.name.show == " / "
28+ (sym.owner eq ctx.requiredClass(tpe.toTermName)) && sym.name == nme. DIV
2829
29- test(" scala.Int" ) || test(" scala.Long" ) || test(" scala.Short" ) || test(" scala.FLoat " ) || test(" scala.Double" )
30+ test(" scala.Int" ) || test(" scala.Long" ) || test(" scala.Short" ) || test(" scala.Float " ) || test(" scala.Double" )
3031 }
3132
3233 override def transformApply (tree : tpd.Apply )(implicit ctx : Context ): tpd.Tree = tree match {
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ import Decorators._
99import Symbols .Symbol
1010import Constants .Constant
1111import transform .{LinkAll , Pickler }
12+ import StdNames ._
1213
1314class DivideZero extends PluginPhase with Plugin {
1415 val name : String = " divideZero"
@@ -23,9 +24,9 @@ class DivideZero extends PluginPhase with Plugin {
2324
2425 private def isNumericDivide (sym : Symbol )(implicit ctx : Context ): Boolean = {
2526 def test (tpe : String ): Boolean =
26- (sym.owner eq ctx.requiredClass(tpe.toTermName)) && sym.name.show == " / "
27+ (sym.owner eq ctx.requiredClass(tpe.toTermName)) && sym.name == nme. DIV
2728
28- test(" scala.Int" ) || test(" scala.Long" ) || test(" scala.Short" ) || test(" scala.FLoat " ) || test(" scala.Double" )
29+ test(" scala.Int" ) || test(" scala.Long" ) || test(" scala.Short" ) || test(" scala.Float " ) || test(" scala.Double" )
2930 }
3031
3132 override def transformApply (tree : tpd.Apply )(implicit ctx : Context ): tpd.Tree = tree match {
Original file line number Diff line number Diff line change @@ -8,6 +8,8 @@ import transform.MegaPhase.MiniPhase
88import Decorators ._
99import Symbols .Symbol
1010import Constants .Constant
11+ import StdNames ._
12+
1113
1214class DivideZero extends MiniPhase with Plugin {
1315 val name : String = " divideZero"
@@ -24,9 +26,9 @@ class DivideZero extends MiniPhase with Plugin {
2426
2527 private def isNumericDivide (sym : Symbol )(implicit ctx : Context ): Boolean = {
2628 def test (tpe : String ): Boolean =
27- (sym.owner eq ctx.requiredClass(tpe.toTermName)) && sym.name.show == " / "
29+ (sym.owner eq ctx.requiredClass(tpe.toTermName)) && sym.name == nme. DIV
2830
29- test(" scala.Int" ) || test(" scala.Long" ) || test(" scala.Short" ) || test(" scala.FLoat " ) || test(" scala.Double" )
31+ test(" scala.Int" ) || test(" scala.Long" ) || test(" scala.Short" ) || test(" scala.Float " ) || test(" scala.Double" )
3032 }
3133
3234 override def transformApply (tree : tpd.Apply )(implicit ctx : Context ): tpd.Tree = tree match {
You can’t perform that action at this time.
0 commit comments