summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2012-12-12 16:05:24 -0800
committerPaul Phillips <paulp@improving.org>2012-12-19 11:51:54 -0800
commit9e88ddf82e2d8aa779aab46aec284d5566deac14 (patch)
tree34bd76cde8ab906d36970a69ac73310d412193b8 /src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala
parent7c23d525ccb413d8ff3e4cc6b442e7e864608609 (diff)
downloadscala-9e88ddf82e2d8aa779aab46aec284d5566deac14.tar.gz
scala-9e88ddf82e2d8aa779aab46aec284d5566deac14.tar.bz2
scala-9e88ddf82e2d8aa779aab46aec284d5566deac14.zip
Eliminating var-like setter tpe_= on Tree.
Deprecated tpe_= on Tree, which is redundant with and less useful than setType. To provide a small layer of insulation from the direct nulling out of mutable fields used to signal the typer, added def clearType() which is merely tree.tpe = null but is shamefaced about the null and var-settings parts like a respectable method should be.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala b/src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala
index 30c12a4286..fe93a0ea76 100644
--- a/src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala
@@ -154,7 +154,7 @@ trait ContextErrors {
// the found/req types.
val foundType: Type = req.normalize match {
case RefinedType(parents, decls) if !decls.isEmpty && found.typeSymbol.isAnonOrRefinementClass =>
- val retyped = typed (tree.duplicate setType null)
+ val retyped = typed (tree.duplicate.clearType())
val foundDecls = retyped.tpe.decls filter (sym => !sym.isConstructor && !sym.isSynthetic)
if (foundDecls.isEmpty || (found.typeSymbol eq NoSymbol)) found
else {
@@ -182,7 +182,7 @@ trait ContextErrors {
}
def ParentTypesError(templ: Template, ex: TypeError) = {
- templ.tpe = null
+ templ.clearType()
issueNormalTypeError(templ, ex.getMessage())
setError(templ)
}