lampepfl/dotty — pull request #243 by odersky (2014-11-26 10:13:45+00:00)
Title: Allow refinements that refine already refined types.

Previously, a double definition errorfor `T` was produced in a case like this:

type T1 = C { T <: A }
type T2 = T1 { T <: B }

This was caused by the way T1 was treated in the refinement class
that is used to typecheck the type. Desugaring of T2 with `refinedTypeToClass`
would give

trait extends T1 { type T <: B }

and `normalizeToClassRefs` would transform this to:

trait extends C { type T <: A; type T <: B }

Hence the double definition. The new scheme desugars the rhs of `T2` to:

trait extends C { this: T1 => type T <: B }

which avoids the problem.

Also, added tests that #232 (fix/boundsPropagation) indeed considers all refinements
together when comparing refined types.

Review by @retronym please.