Skip to content
Snippets Groups Projects
Commit a0698e3e authored by Manos Koukoutos's avatar Manos Koukoutos Committed by Etienne Kneuss
Browse files

Remove MutableTyped. Really this time.

parent f1d7ec44
Branches
Tags
No related merge requests found
......@@ -13,12 +13,6 @@ object Common {
abstract class Tree extends Positioned with Serializable {
def copiedFrom(o: Tree): this.type = {
setPos(o)
(this, o) match {
// do not force if already set
case (t1: MutableTyped, t2: Typed) if !t1.isTyped =>
t1.setType(t2.getType)
case _ =>
}
this
}
......
......@@ -11,30 +11,11 @@ object TypeTrees {
import Definitions._
import TypeTreeOps._
/**
* HasType indicates that structure is typed
*
* setType not necessarily defined though
*/
trait Typed {
def getType: TypeTree
def isTyped : Boolean = (getType != Untyped)
}
trait MutableTyped extends Typed {
self =>
private var _type: Option[TypeTree] = None
def getType: TypeTree = _type getOrElse Untyped
def setType(tt: TypeTree): self.type = _type match {
case None => _type = Some(tt); this
case Some(o) if o != tt => scala.sys.error("Resetting type information! Type [" + o + "] is modified to [" + tt)
case _ => this
}
}
class TypeErrorException(msg: String) extends Exception(msg)
object TypeErrorException {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment