From 053cd236ee12f877cfd71affb9a62a417f917d3d Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Mon, 10 Apr 2017 16:35:01 +0200 Subject: Fix #2152: Instantiate dependent result type parameters #2152 shows that dependent result type parameters can end up in the types of terms, so we have to eliminate them. If we don't we get orphan parameters in pickling. Fix method name and comment --- tests/pos/i2152.scala | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 tests/pos/i2152.scala (limited to 'tests/pos/i2152.scala') diff --git a/tests/pos/i2152.scala b/tests/pos/i2152.scala new file mode 100644 index 000000000..2171a487e --- /dev/null +++ b/tests/pos/i2152.scala @@ -0,0 +1,7 @@ +class Contra[-D](task: AnyRef) +object Test { + def narrow(task: AnyRef): Contra[task.type] = new Contra(task) + def ident[Before](elems: Contra[Before]): Contra[Before] = elems + val foo = null + ident(narrow(foo)) +} -- cgit v1.2.3