summaryrefslogtreecommitdiff
path: root/test/files/neg/names-defaults-neg.check
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2014-02-05 15:30:35 +0100
committerJason Zaugg <jzaugg@gmail.com>2014-02-09 09:23:28 +0100
commit1cf1bae75db5f178026f6602e9a062484fa73a86 (patch)
tree73760dd0427843a11d279fc560803fb60b2a583b /test/files/neg/names-defaults-neg.check
parent3306967c561e3ea34306419d5351b4e20673cc8b (diff)
downloadscala-1cf1bae75db5f178026f6602e9a062484fa73a86.tar.gz
scala-1cf1bae75db5f178026f6602e9a062484fa73a86.tar.bz2
scala-1cf1bae75db5f178026f6602e9a062484fa73a86.zip
SI-8237 Avoid cyclic constraints when inferring hk type args
An `AppliedTypeVars` spawned from `HKTypeVar#applyArgs` (necessarily) shares the same `TypeConstraints`. But, we can have multiple ATVs based on a single HKTV floating around during inference, and they can appear on both sides of type relations. An example of this is traced out in the enclosed test. This commit avoids registering upper/lower bound constraints when this is detected. In the enclosed test, we end up with an empty set of constraints for `?E`, which results in inference of Nothing, which is what we expect. I have also improved the printing of ATVs (to include the args) and sharpened the log message when `solve` leaves type variables instantiated to `NoType`, rather than some other type that doesn't conform to the bounds. Both of these changes helped me to get to the bottom of this ticket. The improved `ATV#toString` shows up in some updated checkfiles. The reported test has quite a checkered history: - in 2.10.0 it worked, but more by good luck than good planning - after the fix for SI-7226 / 221f52757aa6, it started crashing - from 3bd897ba0054f (a merge from 2.10.x just before 2.11.0-M1) we started getting a type inference failure, rather than a crash. "no type parameters for method exists [...] because cyclic instantiation". - It still crashes in `isGround` in 2.10.3.
Diffstat (limited to 'test/files/neg/names-defaults-neg.check')
-rw-r--r--test/files/neg/names-defaults-neg.check2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/files/neg/names-defaults-neg.check b/test/files/neg/names-defaults-neg.check
index 880ddc4327..20ddd55f1f 100644
--- a/test/files/neg/names-defaults-neg.check
+++ b/test/files/neg/names-defaults-neg.check
@@ -88,7 +88,7 @@ names-defaults-neg.scala:76: error: no type parameters for method test4: (x: T[T
--- because ---
argument expression's type is not compatible with formal parameter type;
found : List[Int]
- required: ?T
+ required: ?T[?T[List[?T[X forSome { type X }]]]]
Error occurred in an application involving default arguments.
test4()
^