aboutsummaryrefslogtreecommitdiff
path: root/tests/pos/i2152.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2017-04-10 16:35:01 +0200
committerMartin Odersky <odersky@gmail.com>2017-04-11 18:00:59 +0200
commit053cd236ee12f877cfd71affb9a62a417f917d3d (patch)
treec6e6a1c078e64e1719896f519a3cb95ebf7326d7 /tests/pos/i2152.scala
parent9917029becab32d56e786ac9309ee195737f6da0 (diff)
downloaddotty-053cd236ee12f877cfd71affb9a62a417f917d3d.tar.gz
dotty-053cd236ee12f877cfd71affb9a62a417f917d3d.tar.bz2
dotty-053cd236ee12f877cfd71affb9a62a417f917d3d.zip
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
Diffstat (limited to 'tests/pos/i2152.scala')
-rw-r--r--tests/pos/i2152.scala7
1 files changed, 7 insertions, 0 deletions
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))
+}