summaryrefslogtreecommitdiff
path: root/test/files/pos/t4336.scala
diff options
context:
space:
mode:
authorHubert Plociniczak <hubert.plociniczak@gmail.com>2012-01-30 10:47:24 +0100
committerHubert Plociniczak <hubert.plociniczak@gmail.com>2012-01-30 10:47:24 +0100
commit58679b953933494b5f06d61e82257391bba4091c (patch)
treeaed459512d82d0c7f7db18426058679475754f83 /test/files/pos/t4336.scala
parent5e9dd4a05c25f463f29d0fbc2f1bec194bf7700b (diff)
downloadscala-58679b953933494b5f06d61e82257391bba4091c.tar.gz
scala-58679b953933494b5f06d61e82257391bba4091c.tar.bz2
scala-58679b953933494b5f06d61e82257391bba4091c.zip
Closes #4336.
Some of the type params might already be instantiated if explicit type application is done. Review by @adriaanm
Diffstat (limited to 'test/files/pos/t4336.scala')
-rw-r--r--test/files/pos/t4336.scala19
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]
+ )
+}