From 0a07f7f3385e5cc65fe58db753d2781ecf14ec41 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Sat, 17 Dec 2016 18:14:15 +0100 Subject: Infer type parameters of anonymous class parents from expected type If a parent type of an anonymous class is an Ident or Select which refers to a parameterized type, use the expected type to infer its type parameters. Fixes #1803. --- tests/pos/i1803.scala | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 tests/pos/i1803.scala (limited to 'tests/pos') diff --git a/tests/pos/i1803.scala b/tests/pos/i1803.scala new file mode 100644 index 000000000..19bf21918 --- /dev/null +++ b/tests/pos/i1803.scala @@ -0,0 +1,7 @@ +class C[T] + +object Test { + def f(x: C[Int]) = ??? + + f(new C {}) +} -- cgit v1.2.3