From 15a63974d23511a3a879c3354552bed504061617 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Sat, 12 Oct 2013 14:18:02 +0200 Subject: New invariant: refined types must have a refined info that's more specific than the previous bounds. Making use of this to make comparisons of refined types with the same names more efficient. Also, to make findMember on refined type with type refinement more efficient. --- src/dotty/tools/dotc/typer/Typer.scala | 1 + 1 file changed, 1 insertion(+) (limited to 'src/dotty/tools/dotc/typer/Typer.scala') diff --git a/src/dotty/tools/dotc/typer/Typer.scala b/src/dotty/tools/dotc/typer/Typer.scala index 0e246480c..1e3049f7e 100644 --- a/src/dotty/tools/dotc/typer/Typer.scala +++ b/src/dotty/tools/dotc/typer/Typer.scala @@ -669,6 +669,7 @@ class Typer extends Namer with Applications with Implicits { 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))) + // todo later: check that refinement is within bounds } cpy.RefinedTypeTree(tree, tpt1, refinements1) withType (tpt1.tpe /: refinements1)(addRefinement) -- cgit v1.2.3