aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/typer/Typer.scala
diff options
context:
space:
mode:
authorodersky <odersky@gmail.com>2014-11-26 09:25:40 +0100
committerodersky <odersky@gmail.com>2014-11-26 09:25:40 +0100
commit5733684a4ec6857ece1048d56654dcd749163510 (patch)
treedfa3b78fe47141bf145f6b9fe4664cbe2e8513e5 /src/dotty/tools/dotc/typer/Typer.scala
parent779afd2f65f967ec5af1ac5ec7464ad5851852ad (diff)
parenta2884d5338e139fb2ff795b3d08947df58f9b953 (diff)
downloaddotty-5733684a4ec6857ece1048d56654dcd749163510.tar.gz
dotty-5733684a4ec6857ece1048d56654dcd749163510.tar.bz2
dotty-5733684a4ec6857ece1048d56654dcd749163510.zip
Merge pull request #238 from dotty-staging/fix/bounds-propagation-v2
Fix/bounds propagation v2
Diffstat (limited to 'src/dotty/tools/dotc/typer/Typer.scala')
-rw-r--r--src/dotty/tools/dotc/typer/Typer.scala10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/dotty/tools/dotc/typer/Typer.scala b/src/dotty/tools/dotc/typer/Typer.scala
index 4bb6e172b..9ef73f0b6 100644
--- a/src/dotty/tools/dotc/typer/Typer.scala
+++ b/src/dotty/tools/dotc/typer/Typer.scala
@@ -20,6 +20,7 @@ import NameOps._
import Flags._
import Decorators._
import ErrorReporting._
+import Checking._
import EtaExpansion.etaExpand
import dotty.tools.dotc.transform.Erasure.Boxing
import util.Positions._
@@ -761,14 +762,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
assert(tree.refinements.length == refinements1.length, s"${tree.refinements} != $refinements1")
def addRefinement(parent: Type, refinement: Tree): Type = {
typr.println(s"adding refinement $refinement")
- def checkRef(tree: Tree, sym: Symbol) =
- if (sym.maybeOwner == refineCls && tree.pos.start <= sym.pos.end)
- ctx.error("illegal forward reference in refinement", tree.pos)
- refinement foreachSubTree {
- case tree: RefTree => checkRef(tree, tree.symbol)
- case tree: TypeTree => checkRef(tree, tree.tpe.typeSymbol)
- case _ =>
- }
+ checkRefinementNonCyclic(refinement, refineCls)
val rsym = refinement.symbol
val rinfo = if (rsym is Accessor) rsym.info.resultType else rsym.info
RefinedType(parent, rsym.name, rt => rinfo.substThis(refineCls, RefinedThis(rt)))