aboutsummaryrefslogtreecommitdiff
path: root/tests/pos/i1044.scala
diff options
context:
space:
mode:
authorGuillaume Martres <smarter@ubuntu.com>2016-02-06 00:51:20 +0100
committerGuillaume Martres <smarter@ubuntu.com>2016-02-06 01:21:49 +0100
commit534e4ad9f6ef1dfb767adc89c9544484cab4f48a (patch)
tree8a7a24b5fe18abc4917a32790a1ef0b7fa247abc /tests/pos/i1044.scala
parent2c08c72a7f9b968e1f659d1d3d811f3166524983 (diff)
downloaddotty-534e4ad9f6ef1dfb767adc89c9544484cab4f48a.tar.gz
dotty-534e4ad9f6ef1dfb767adc89c9544484cab4f48a.tar.bz2
dotty-534e4ad9f6ef1dfb767adc89c9544484cab4f48a.zip
Fix #1044: handle TypevarsMissContext mode in wildApprox
When `wildApprox` encounters a PolyParam it approximates it by its bounds in the current constraint set, but this is incorrect if `TypevarsMissContext` is set, we might get the bounds of another use of this `PolyType`. This is exactly what happened in i1044.scala where the implicit view `refArrayOps` needs to be used twice with two different type parameters. The fix is to approximate a PolyParam by its original bounds in its PolyType if `TypevarsMissContext` is set. This fix was inspired by the approach of #1054.
Diffstat (limited to 'tests/pos/i1044.scala')
-rw-r--r--tests/pos/i1044.scala3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/pos/i1044.scala b/tests/pos/i1044.scala
new file mode 100644
index 000000000..a984dbd67
--- /dev/null
+++ b/tests/pos/i1044.scala
@@ -0,0 +1,3 @@
+object Test {
+ val x = ???.getClass.getMethods.head.getParameterTypes.mkString(",")
+}