scala/scala — pull request #1706 by retronym (2012-12-04 19:20:45+00:00)
Title: SI-5361 Avoid cyclic type with malformed refinement

The statement `val x = this` in the refinment type:

(new {}): {val x = this}

is lazily typechecked, in order to, according to the comment
in `typedRefinment, "avoid cyclic reference errors".

But the approximate type used ends up with:

Refinment@1(
parents = [...]
decls = { val x: Refinement@1 })

This commit eagerly checks that there is no term definitions
in type refinments, rather than delaying this.

This changes the error message for SI-3614.

Review by @adriaanm