From 58679b953933494b5f06d61e82257391bba4091c Mon Sep 17 00:00:00 2001 From: Hubert Plociniczak Date: Mon, 30 Jan 2012 10:47:24 +0100 Subject: Closes #4336. Some of the type params might already be instantiated if explicit type application is done. Review by @adriaanm --- test/files/pos/t4336.scala | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 test/files/pos/t4336.scala (limited to 'test') 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] + ) +} -- cgit v1.2.3