diff options
author | Paul Phillips <paulp@improving.org> | 2012-01-06 07:29:20 -0800 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2012-01-06 12:01:17 -0800 |
commit | dd14b6a9b8b3355fae847f7fc8c1fc7d41babaa5 (patch) | |
tree | 24c52537a38e90e44be23e5488889e51099912a7 /test/files/neg | |
parent | 3192048a4bfb59966f93bb87a3c4f6b7ccfc80b2 (diff) | |
download | scala-dd14b6a9b8b3355fae847f7fc8c1fc7d41babaa5.tar.gz scala-dd14b6a9b8b3355fae847f7fc8c1fc7d41babaa5.tar.bz2 scala-dd14b6a9b8b3355fae847f7fc8c1fc7d41babaa5.zip |
TypeVar tracing.
% scala -Dscalac.debug.tvar
scala> class Foo[CC[X] <: Traversable[X]] { def bar[T](xs: CC[T]) = xs.head }
defined class Foo
scala> new Foo bar List(1,2,3)
[ create] ?CC ( In Foo[CC[X] <: Traversable[X]] )
[ create] ?CC ( In Foo[CC[X] <: Traversable[X]] )
[ setInst] Nothing ( In Foo[CC[X] <: Traversable[X]], CC=Nothing )
[ create] ?CC ( In Foo[CC[X] <: Traversable[X]] )
[ create] ?T ( In Foo[CC[X] <: Traversable[X]]#bar[T] )
[ create] ?A ( In List#apply[A] )
[ create] ?A ( In List#apply[A] )
[ setInst] Int ( In List#apply[A], A=Int )
[ create] ?CC ( In Foo[CC[X] <: Traversable[X]] )
[ create] ?T ( In Foo[CC[X] <: Traversable[X]]#bar[T] )
[ create] ?CC ( In Foo[CC[X] <: Traversable[X]] )
[ applyArgs] ?CC ( In Foo[CC[X] <: Traversable[X]], apply args ?T to CC )
[ setInst] List ( In Foo[CC[X] <: Traversable[X]], CC=List )
[ setInst] Int ( In Foo[CC[X] <: Traversable[X]]#bar[T], T=Int )
res0: Int = 1
Also, I gave TypeVar some polymorphism. Review by @moors.
Diffstat (limited to 'test/files/neg')
-rw-r--r-- | test/files/neg/names-defaults-neg.check | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/test/files/neg/names-defaults-neg.check b/test/files/neg/names-defaults-neg.check index 01ef54e0ea..01bbe2de4e 100644 --- a/test/files/neg/names-defaults-neg.check +++ b/test/files/neg/names-defaults-neg.check @@ -83,7 +83,7 @@ names-defaults-neg.scala:76: error: no type parameters for method test4: (x: T[T --- because --- argument expression's type is not compatible with formal parameter type; found : List[Int] - required: ?T[?T[List[?T[X forSome { type X }]]]] + required: ?T Error occurred in an application involving default arguments. test4() ^ |