diff options
author | Paul Phillips <paulp@improving.org> | 2012-01-30 11:55:19 -0800 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2012-01-30 11:55:19 -0800 |
commit | 77291ed5e9f707f8014b40ec002091f46e5adba0 (patch) | |
tree | a1bf55d74d5222b9921d34a8ac6b4dc27ed4f1bb /test/files/pos | |
parent | d762e4caf9e201e597a76566eb9f61ad53b5f4cf (diff) | |
parent | 84fd439fb1c2f08439e539aea4f9657c6768bc83 (diff) | |
download | scala-77291ed5e9f707f8014b40ec002091f46e5adba0.tar.gz scala-77291ed5e9f707f8014b40ec002091f46e5adba0.tar.bz2 scala-77291ed5e9f707f8014b40ec002091f46e5adba0.zip |
Merge branch 'master' into inline
Diffstat (limited to 'test/files/pos')
-rw-r--r-- | test/files/pos/t4336.scala | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/files/pos/t4336.scala b/test/files/pos/t4336.scala new file mode 100644 index 0000000000..e10d001585 --- /dev/null +++ b/test/files/pos/t4336.scala @@ -0,0 +1,19 @@ +object Main { + class NonGeneric {} + class Generic[T] {} + + class Composite { + def contains(setup : Composite => Unit) : Composite = this + } + + def generic[T](parent: Composite): Generic[T] = new Generic[T] + def nonGeneric(parent: Composite): NonGeneric = new NonGeneric + + new Composite().contains( + nonGeneric // should have type Composite => NonGeneric + ) + + new Composite().contains( + generic[Int] // should have type Composite => Generic[Int] + ) +} |