@@ -5,7 +5,6 @@ import core._
55import Contexts ._
66import Types ._
77import Symbols ._
8- import StdNames ._
98import Decorators ._
109import typer .ProtoTypes ._
1110import ast .{tpd , untpd }
@@ -25,20 +24,17 @@ import config.Printers.typr
2524class ReTyper extends Typer {
2625 import tpd ._
2726
28- private def assertTyped (tree : untpd.Tree )(implicit ctx : Context ): Unit =
29- assert(tree.hasType, i " $tree ${tree.getClass} ${tree.uniqueId}" )
30-
3127 /** Checks that the given tree has been typed */
3228 protected def promote (tree : untpd.Tree )(implicit ctx : Context ): tree.ThisTree [Type ] = {
33- assertTyped (tree)
29+ assert (tree.hasType, i " $tree ${tree.getClass} ${tree.uniqueId} " )
3430 tree.withType(tree.typeOpt)
3531 }
3632
3733 override def typedIdent (tree : untpd.Ident , pt : Type )(implicit ctx : Context ): Tree =
3834 promote(tree)
3935
4036 override def typedSelect (tree : untpd.Select , pt : Type )(implicit ctx : Context ): Tree = {
41- assertTyped( tree)
37+ assert(tree.hasType, tree)
4238 val qual1 = typed(tree.qualifier, AnySelectionProto )
4339 untpd.cpy.Select (tree)(qual1, tree.name).withType(tree.typeOpt)
4440 }
@@ -52,22 +48,11 @@ class ReTyper extends Typer {
5248 override def typedSuper (tree : untpd.Super , pt : Type )(implicit ctx : Context ): Tree =
5349 promote(tree)
5450
55- override def typedTyped (tree : untpd.Typed , pt : Type )(implicit ctx : Context ): Tree = {
56- assertTyped(tree)
57- val tpt1 = checkSimpleKinded(typedType(tree.tpt))
58- val expr1 = tree.expr match {
59- case id : untpd.Ident if (ctx.mode is Mode .Pattern ) && untpd.isVarPattern(id) && (id.name == nme.WILDCARD || id.name == nme.WILDCARD_STAR ) =>
60- tree.expr.withType(tpt1.tpe)
61- case _ => typed(tree.expr)
62- }
63- untpd.cpy.Typed (tree)(expr1, tpt1).withType(tree.typeOpt)
64- }
65-
6651 override def typedTypeTree (tree : untpd.TypeTree , pt : Type )(implicit ctx : Context ): TypeTree =
6752 promote(tree)
6853
6954 override def typedBind (tree : untpd.Bind , pt : Type )(implicit ctx : Context ): Bind = {
70- assertTyped (tree)
55+ assert (tree.hasType )
7156 val body1 = typed(tree.body, pt)
7257 untpd.cpy.Bind (tree)(tree.name, body1).withType(tree.typeOpt)
7358 }
@@ -79,10 +64,6 @@ class ReTyper extends Typer {
7964 untpd.cpy.UnApply (tree)(fun1, implicits1, patterns1).withType(tree.tpe)
8065 }
8166
82- override def typedUnApply (tree : untpd.Apply , selType : Type )(implicit ctx : Context ): Tree = {
83- typedApply(tree, selType)
84- }
85-
8667 override def localDummy (cls : ClassSymbol , impl : untpd.Template )(implicit ctx : Context ) = impl.symbol
8768
8869 override def retrieveSym (tree : untpd.Tree )(implicit ctx : Context ): Symbol = tree.symbol
0 commit comments