aboutsummaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Don't make * types higher-kinded in avoidMartin Odersky2016-07-112-10/+10
| | | | Also, fix error counts in tests for new hk scheme.
* Change testsMartin Odersky2016-07-116-0/+0
| | | | | | | | | | | | | | | | - compileMixed failed because there was a cycle between immutable.Seq (compiled) and parallel.ParSeq (loaded from classfile). Inspection of the completion log (turn completions Printer on) and the stack trace showed that there's nothing we can do here. The old hk scheme did not go into the cycle because it did not force an unrelated type. I believe with enough tweaking we would also hva egotten a cycle in the old hk scheme. The test is "fixed" by adding parallel.ParSeq to the files to compile. - Disable named parameter tests Those tests do not work yet with the revised hk scheme. Before trying to fix this, we should first decide what parts of named parameters should be kept.
* Eta-expand unapplied types that have type parametersMartin Odersky2016-07-115-26/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We would like to change from a scheme where eta-expansion was prototype driven to one where unapplied parameterized types are always eta expanded. The reason is that we might miss some eta expansions due to cyclic references. run/colltest4 is an exmaple. Here, we missed an eta expansion in the type of Iterator. The class definition is: trait Iterable[+A] extends IterableOnce[A] with FromIterable[Iterable] { We'd expect that the second parent would expand to FromIterable[[X0] -> Iterable[X0]] But we miss the expansion because at the time we complete Iterable we have not completed FromIterable yet. In fact this happens in both the old and the new hk scheme. But in the old scheme we did not notice the error whereas in the new scheme we get an error in PostTyper that the type Iterable does not conform to its bound `[X0] -> Iterable[X0]`. With this commit, we change the scheme, so that eta-expansion depends on the type parameters of a type itself, instead of the expected type. We should investigate whether we can do a similar change for Scala2 classloading. Check kinds of type parameters Also, do not allow a hk type if the bound is a * type.
* Add a second betaReduceMartin Odersky2016-07-111-1/+1
| | | | | | | | | | | | | The new one only reduces straight applications of type lambdas with definite arguments. It is called very early on appliedTo, and derivedRefinedType. The old one, now renamed to normalizeHkApply also handles wildcard arguments and can garbage collect general unneeded hk-refinements. It is called later, at various places. TODO: See what functionality of normalizeHkApply should go into betaReduce instead. Maybe we can even drop normalizeHkApply? However: need to be careful to maintain aliases for hk type inference.
* Normalize RecTypes on creation to avoid cycles.Martin Odersky2016-07-111-20/+21
| | | | | With this change, ski compiles (but with more errors than before). Without it, it goes into various infinite recursions.
* Introduce recursive typesMartin Odersky2016-07-112-2/+4
| | | | | | | | | | | | | | | | | Map self-references in refinements to recursive types. This commit does this for refinement types appearing in source. We still have to do it for unpickled refinements. Test apply-equiv got moved to pending because it simulates the old higher-kinded type encoding in source, which relies on the old representation in terms of self-referential refinement types. The plan is not to adapt this encoding to the new representation, but to replace it with a different encoding that makes critical use of the added power of recursive types. Use recursive types also when unpickling from Scala 2.x. Add mapInfo method to Denotations.
* Test for #1366Martin Odersky2016-07-081-0/+6
|
* Merge pull request #1315 from nicolasstucki/optimize-try-casesDmitry Petrashko2016-06-303-0/+194
|\ | | | | Fix #856: Handle try/catch cases as catch cases if possible.
| * Fix #856: Handle try/catch cases as catch cases if possible.Nicolas Stucki2016-06-283-0/+194
| | | | | | | | | | | | | | Previously they were all lifted into a match with the came cases. Now the first cases are handled directly by by the catch. If one of the cases can not be handled the old scheme is applied to to it and all subsequent cases.
* | partest: correct line numbers in run stack tracesGuillaume Martres2016-06-301-3/+3
|/ | | | | | | partest adds a warning in a comment at the beginning of source files that it copies, but this means that every line number displayed in a stack trace is offset by 6. We can workaround this by making the warning a single line with no newline at the end.
* Merge pull request #1226 from dotty-staging/static-fixesDmitry Petrashko2016-06-224-0/+29
|\ | | | | Multiple fixes to @static
| * Add tests that were used to reproduce issues with LazyVals.Dmitry Petrashko2016-06-072-0/+14
| |
| * Test #1224.Dmitry Petrashko2016-06-071-0/+11
| |
| * Test #1220Dmitry Petrashko2016-06-071-0/+4
| |
* | Merge pull request #1309 from felixmulder/topic/fix#1307Dmitry Petrashko2016-06-221-0/+7
|\ \ | | | | | | Fix issue with GADT not typechecking without bind in match
| * | Fix issue with GADT not typechecking without bind in matchFelix Mulder2016-06-061-0/+7
| | |
* | | better handling of overloaded extractorsliu fengyun2016-06-201-0/+38
| |/ |/|
* | Merge pull request #1302 from dotty-staging/fix/partest-cli-errorDmitry Petrashko2016-06-071-0/+2
|\ \ | |/ |/| Properly report errors when cli flags are malformed
| * Properly report errors when cli flags are malformedGuillaume Martres2016-06-021-0/+2
| | | | | | | | | | Previously we returned an empty Reporter with no errors so partest reported the test as a success.
* | Overloading resolution: prefer directly applicable methodsGuillaume Martres2016-06-032-0/+17
| | | | | | | | | | | | | | | | | | | | | | If directly applicable alternatives exists, do not try other alternatives. The original motivation for this change was to reduce the number of searches for implicit views we do since some overloaded methods like `Int#+` are used a lot, but it turns out that this also makes more code compile (see `overload_directly_applicable.scala` for an example), this change does not seem to match what the specification says (it does not define a notion of "directly applicable") but it does match the behavior of scalac, and it seems useful in general.
* | Do not miss implicits in type parameters of parentsGuillaume Martres2016-05-311-0/+12
| | | | | | | | | | This did not work before because we incorrectly looked for their value in the prefix of the type instead of the type itself.
* | Fix implicit scope caching bugGuillaume Martres2016-05-311-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The issue is subtle: the `tp` in scope in `def ofTypeImplicits` is the `tp` passed to the top-level `implicitScope` method, not the `tp` passed to the recursively called `iscope`, this means that before this commit, all intermediate `OfTypeImplicit` scopes cached while computing an implicit scope had their `tp` field incorrectly set, which means that we could miss implicits in later implicit searches. Note that the `implicit_cache.scala` test worked before this commit because of the restrictions on caching that exist since b8b0f381ef2cbcb7bad66fd3e7a9ae929baa45f6, it is included anyway because our caching strategy might change in the future.
* | Document why we cannot cache all implicit scopesGuillaume Martres2016-05-311-0/+17
|/
* Merge pull request #1281 from dotty-staging/fix-lamda-liftodersky2016-05-271-0/+11
|\ | | | | Fixes to lambdalift that prevent memory leaks.
| * Fix deadlock in t5375 and similar tests.Dmitry Petrashko2016-05-261-0/+11
| | | | | | | | See t5375.scala for details.
* | Add test for SI-9795Felix Mulder2016-05-271-0/+7
| |
* | Add test for previous ensuring correct bindsFelix Mulder2016-05-272-0/+5
| |
* | Annotate repeated params with `case` flag to indicate that they are legalFelix Mulder2016-05-272-5/+2
| | | | | | | | | | | | | | One drawback with this approach is that the type seems to propagate. I.e. if the return type of an expression is `repeated` then the enclosing variable will get the `repeated` type instead of getting the expected `Seq` type
* | Fix double evaluation of scrutinee with side-effects, add testFelix Mulder2016-05-262-0/+17
| |
* | Don't evaluate isInstanceOf for value classes, disable bugged testsFelix Mulder2016-05-265-3/+8
| | | | | | | | | | | | | | The tests `i1059.scala` and `t3480.scala` are failing due to a bug in pattern matcher that evaluates the `x` in `List(x: _*)` incorrectly. Concerned issue: #1276
* | Add Eq instances of standard types to PredefMartin Odersky2016-05-231-1/+10
| | | | | | | | | | | | | | | | | | To make tests pass, this required a looser specification of `assumedCanEquals`, so that an abstract type T can be compared to arbitrary values, as long as its upper bound can be compared. E.g. T == null T == "abc"
* | Add Java types to equality testMartin Odersky2016-05-231-0/+21
| |
* | Make Eq contravariantMartin Odersky2016-05-231-5/+4
| | | | | | | | (and add it to commit set).
* | Test caseMartin Odersky2016-05-231-0/+80
| |
* | Hooks to check that comparisons with == / != make senseMartin Odersky2016-05-232-96/+126
| | | | | | | | | | | | | | | | | | | | Also, check that pattern matching against idents/selects/literals makes sense. The hooks perform an implicit search for an instance of `Eq[L, R]`, where `L`, `R` are the argument types. So far this always succeeeds because Eq.eqAny matches all such types. A separate commit will check the returned search term for validity.
* | Add new strawman for multiversal equalityMartin Odersky2016-05-231-0/+96
| |
* | Downwards comparisons for implicit search and overloading resolutionMartin Odersky2016-05-231-0/+0
| | | | | | | | | | | | | | | | | | Compare selected contravariant arguments as if they were covariant. Which ones is explained in the doc comment for method `isAsSpecificValueType` in Applications.scala. This has the same motivation than what @paulp proposed around 2012. The solution is a bit different from the one proposed then because it only affects top-level parameters.
* | Two more testsMartin Odersky2016-05-192-0/+30
| | | | | | | | Unrelated to other commits but useful to get in.
* | Remove stray testMartin Odersky2016-05-191-17/+0
| | | | | | | | Real test is in neg/customargs
* | Handle MergeErrors in RefChecksMartin Odersky2016-05-192-14/+26
| | | | | | | | | | Used to throw an uncaught merge error in checkAllOverrides when compiling i1240c.scala.
* | Another test case involving super accessorsMartin Odersky2016-05-182-2/+19
| |
* | A test case for overloading/overriding interactionsMartin Odersky2016-05-181-0/+27
| | | | | | | | | | This showcases a tricky interaction between overloading and overriding. See discussion of #1240 for context.
* | Issue MergeError exception for double def situationsMartin Odersky2016-05-182-17/+20
| | | | | | | | | | | | | | | | When finding two symbols in the same class that have the same signature as seen from some prefix, issue a merge error. This is simpler and more robust than the alternative of producing an overloaded denotation and dealing with it afterwards.
* | Fix test caseMartin Odersky2016-05-181-2/+2
| |
* | Test caseMartin Odersky2016-05-181-0/+40
|/
* Revert Scanners and Tokens to their original formFelix Mulder2016-04-282-36/+1
| | | | | Since we decided to go with the non dotty-scanner approach these are unnecessary to have altered, might just as well revert them.
* Allow dependent method type for unapply.Martin Odersky2016-04-271-0/+14
|
* Revert: Better error diagnostics for "not an extractor" errors.Martin Odersky2016-04-271-27/+0
| | | | | No longer needed because we are going to allow dependent method types in extractors, and the unary requirement is kind of obvious.
* Better error diagnostics for "not an extractor" errors.Martin Odersky2016-04-271-0/+27
| | | | | Now explains in detail why an possibly found unapply or unapplySeq is ineligible.
* Test caseMartin Odersky2016-04-271-0/+16
|