diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2013-10-29 22:39:55 +0100 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2014-01-31 21:46:38 +0100 |
commit | d607009532ccb1fcbf91ceca6021f4e09d61672f (patch) | |
tree | 7f5ae7265c8f99d3ab5b6d90cee478396a2d6b33 | |
parent | 9da3710c55ff600a352d52e25b87d024511e4f1a (diff) | |
download | scala-d607009532ccb1fcbf91ceca6021f4e09d61672f.tar.gz scala-d607009532ccb1fcbf91ceca6021f4e09d61672f.tar.bz2 scala-d607009532ccb1fcbf91ceca6021f4e09d61672f.zip |
Optimize typedDefDef: disable some checks post typer
isPossibleRefinement reported as 1% of my profile, about half of that
was reported from the `EraserTyper`.
This commit restricts `checkMethodStructuralCompatible` to
the typer phase, and also moves in the feature warning for
implicits which was nearby.
I've also made a minor optimization to `overriddenSymbol` by
avoiding computing the method schema repeatedly.
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Typers.scala | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala index d55192aa54..c191686293 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -2233,14 +2233,14 @@ trait Typers extends Adaptations with Tags with TypersTracking with PatternTyper DeprecatedParamNameError(p, n) } } - } - if (meth.isStructuralRefinementMember) - checkMethodStructuralCompatible(ddef) + if (meth.isStructuralRefinementMember) + checkMethodStructuralCompatible(ddef) - if (meth.isImplicit && !meth.isSynthetic) meth.info.paramss match { - case List(param) :: _ if !param.isImplicit => - checkFeature(ddef.pos, ImplicitConversionsFeature, meth.toString) - case _ => + if (meth.isImplicit && !meth.isSynthetic) meth.info.paramss match { + case List(param) :: _ if !param.isImplicit => + checkFeature(ddef.pos, ImplicitConversionsFeature, meth.toString) + case _ => + } } treeCopy.DefDef(ddef, typedMods, ddef.name, tparams1, vparamss1, tpt1, rhs1) setType NoType |