diff options
author | Paul Phillips <paulp@improving.org> | 2012-12-21 12:39:02 -0800 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@typesafe.com> | 2012-12-28 15:15:52 -0800 |
commit | 394cc426c1ff1da53146679b4e2995ece52a133e (patch) | |
tree | a93bf5d05957f3e6b9100e3365c9a1cf0aa1f181 /test/files/neg/t4877.check | |
parent | ed40f5cbdf35d09b02898e9c0950b9bd34c1f858 (diff) | |
download | scala-394cc426c1ff1da53146679b4e2995ece52a133e.tar.gz scala-394cc426c1ff1da53146679b4e2995ece52a133e.tar.bz2 scala-394cc426c1ff1da53146679b4e2995ece52a133e.zip |
Fix and simplify typedTypeConstructor.
Investigating the useful output of devWarning (-Xdev people,
it's good for you) led back to this comment:
"normalize to get rid of type aliases"
You may know that this is not all the normalizing does.
Normalizing also turns TypeRefs with unapplied arguments
(type constructors) into PolyTypes. That means that when
typedParentType would call typedTypeConstructor it would
find its parent had morphed into a PolyType. Not that it
noticed; it would blithely continue and unwittingly discard
the type arguments by way of appliedType (which smoothly
logged the incident, thank you appliedType.)
The simplification of typedTypeConstructor:
There was a whole complicated special treatment of AnyRef
here which appears to have become unnecessary. Removed special
treatment and lit a candle for regularity.
Updated lots of tests regarding newly not-so-special AnyRef.
Diffstat (limited to 'test/files/neg/t4877.check')
-rw-r--r-- | test/files/neg/t4877.check | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test/files/neg/t4877.check b/test/files/neg/t4877.check index a4b1e6a50d..5a2413ca8b 100644 --- a/test/files/neg/t4877.check +++ b/test/files/neg/t4877.check @@ -1,10 +1,10 @@ t4877.scala:4: error: type mismatch; - found : Object{def bar: Int} + found : AnyRef{def bar: Int} required: AnyRef{def bar: String} def foo: AnyRef { def bar: String } = new AnyRef { def bar = 42 } ^ t4877.scala:6: error: type mismatch; - found : Object{def bar(x: Int): String} + found : AnyRef{def bar(x: Int): String} required: AnyRef{def bar(x: Int): Int} def foo3: AnyRef { def bar(x: Int): Int } = new AnyRef { def bar(x: Int) = "abc" } ^ @@ -14,7 +14,7 @@ t4877.scala:7: error: type mismatch; def foo4: C { def bar(x: Int): Int ; def quux(x: Int): Int } = new C { def bar(x: Int) = 5 } ^ t4877.scala:17: error: type mismatch; - found : Object{type Mom = String; def bar(x: Int): Int; def bippy(): List[Int]} + found : AnyRef{type Mom = String; def bar(x: Int): Int; def bippy(): List[Int]} required: B.this.Bippy (which expands to) AnyRef{type Mom; def bar(x: Int): this.Mom; def bippy(): List[this.Mom]} val x: Bippy = new AnyRef { |