aboutsummaryrefslogtreecommitdiff
path: root/compiler/src/dotty
Commit message (Collapse)AuthorAgeFilesLines
* fix #1779: support $_ and $_id in interpolated stringliu fengyun2016-12-082-1/+5
|
* Merge pull request #1778 from dotty-staging/fix-i1773liu fengyun2016-12-081-0/+6
|\ | | | | Fix #1773: handle patterns in interpolated string
| * fix #1773: handle patterns in interpolated stringliu fengyun2016-12-081-0/+6
| |
* | handle ConstantType in TypeComparerReto Hablützel2016-12-041-0/+5
|/
* Merge pull request #1658 from dotty-staging/fix-#1639odersky2016-12-035-56/+101
|\ | | | | Fix #1639: Changes around implicits and apply methods
| * Avoid inserting multiple .apply's.Martin Odersky2016-11-242-11/+25
| | | | | | | | | | | | This can lead to stackoverflow, as i1639.scala shows. Fixes #1639.
| * Avoid recomputation of companionRefsMartin Odersky2016-11-241-31/+30
| | | | | | | | | | | | | | When tracing i1639.scala it became apparent that we compute a lot of companion refs. This commit avoids this by better book-keeping what is valid and what is not and more aggressive caching.
| * Better reporting of nested implicit failuresMartin Odersky2016-11-243-15/+47
| | | | | | | | | | Error messages of nested implicit failures are now reported with the top-level message if -explaintypes is set.
* | Merge pull request #1758 from dotty-staging/change-functionsodersky2016-12-037-97/+225
|\ \ | | | | | | Drop function 22 limit
| * | Adress reviewers commentsMartin Odersky2016-12-012-11/+14
| | |
| * | Add missing fileMartin Odersky2016-11-301-1/+2
| | |
| * | Drop function 22 limit.Martin Odersky2016-11-304-22/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Functions with more than 22 parameters are now automatically converted to functions taking a single object array parameter. This has been achieved by tweaking erasure. Other things I have tried that did ot work out well: - Use a single function type in typer. The problem with this one which could not be circumvented was that existing higher-kinded code with e.g. Funcor assumes that Functon1 is a binary type constructor. - Have a late phase that converts to FunctonXXL instead of doing it in erasure. The problem with that one was that potentially every type could be affected, which was ill-suited to the architecture of a miniphase.
| * | Drop limit 30 of generated function classesMartin Odersky2016-11-292-26/+61
| | | | | | | | | | | | | | | Function classes beyond 22 are now generated on demand, with no upper limit.
| * | Create FunctionN types on demandMartin Odersky2016-11-293-1/+26
| | | | | | | | | | | | | | | | | | We know create FunctionN types on demand whenever their name is looked up in the scope of package `scala`. This obviates the need to predefine function traits 23 to 30.
| * | Make clear where symbols are entered or not.Martin Odersky2016-11-291-51/+51
| | | | | | | | | | | | | | | | | | In definitions some of the new... methods entered the created symbol while others did not. We now make that distrinction clear in the name.
* | | Merge pull request #1685 from dotty-staging/fix-1665Dmitry Petrashko2016-12-031-4/+14
|\ \ \ | | | | | | | | Fix #1665: Check that != has an operand on the left.
| * | | Fix #1665: Check that != has an operand on the left.Nicolas Stucki2016-12-011-4/+14
| | | |
* | | | Address reviewers commentsMartin Odersky2016-12-012-3/+7
| | | |
* | | | Fix #1647 Evaluate annotation arguments in proper contextMartin Odersky2016-12-012-3/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Need to evaluate annotation arguments in an expression context, since classes defined in asuch arguments should not be entered into enclosing class. Fixes #1647
* | | | New phase for entering annotationsMartin Odersky2016-12-015-27/+111
| | | | | | | | | | | | | | | | | | | | | | | | If we want to do annotation macros right, we need to add annotations before completing definitions. This commit achieves that by adding a new "phase" between index and typecheck.
* | | | Make phasesStack more robustMartin Odersky2016-12-011-1/+4
| | | | | | | | | | | | | | | | Got a "next on empty iterator" exception before.
* | | | Fix import disablingMartin Odersky2016-12-013-23/+35
| | | | | | | | | | | | | | | | It was broken before, since it worked only on wildcard imports.
* | | | Clean up importsMartin Odersky2016-12-015-9/+7
| | | | | | | | | | | | | | | | | | | | Honor the new scheme where any explicit import of a root import will disable the root import.
* | | | Be more lazy in namedImportRefMartin Odersky2016-12-011-21/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We got a hard to track down error when changing to the new annotations elaboration scheme (should be in the next commit): When running `testNonCyclic`, `DotClass` was not found in object Trees even though it was imported from `util`. It turned out that the import was ignored because the `util` symbol was completing. This commit adds a warning when this happens. The warning currently applies only to named imports because several false negatives were encountered if we do this also on wildcard imports. I.e. we get a warning, but the searched after symbol is not a member of the wildcard qualifier. This commit also refactors namedImportRef, so that `site` is only computed when the name to reseolve appears in the selector list. That change made the previously observed error go away because less is now forced.
* | | | Better printing of import symbolsMartin Odersky2016-12-012-7/+7
| | | | | | | | | | | | | | | | | | | | Had duplications of `import` before. Also: add import info when printing contexts.
* | | | Fix $1753 Better comparison of path typesMartin Odersky2016-11-301-2/+4
| |/ / |/| | | | | | | | | | | | | | In this case, a path went through a type parameter which was aliased to a singleton type. Need to dealias to get to the special case handling two paths.
* | | fix #1748: desugaring with StringContext in PatDefliu fengyun2016-11-271-0/+2
| | |
* | | Merge pull request #1719 from dotty-staging/fix-#1705odersky2016-11-241-33/+43
|\ \ \ | | | | | | | | Fix #1707: Survive non-existing positions in parser
| * | | Rename ...Pos to ...Offset and add pointOffsetMartin Odersky2016-11-241-36/+37
| | | |
| * | | More robust scheme for taking start/end of positions when parsingMartin Odersky2016-11-241-31/+40
| | |/ | |/| | | | | | | | | | | | | | | | Some trees, which do not consume input have unassigned positions (so that they can fit in whatever range they are integrated). It's therefore risky to take the start or end of a parsed tree's position. This commit guards against the case where the position of the tree does not exist.
* | | Merge pull request #1742 from dotty-staging/topic/colon-in-printerFelix Mulder2016-11-241-5/+34
|\ \ \ | |/ / |/| | Fix colons in printer
| * | Make `findTypes` take the `resultType` of `MethodType`Felix Mulder2016-11-242-12/+13
| | | | | | | | | | | | | | | This is done so that we can use show for the entire method except for the ascribed type added by the compiler on success.
| * | Fix defs not being printed correctlyFelix Mulder2016-11-241-3/+22
| | |
| * | Add colon after method type, prefix def/val/var in REPLReto Hablützel2016-11-242-3/+12
| | |
* | | Enable GADT matching for pattern valuesMartin Odersky2016-11-241-1/+3
|/ / | | | | | | | | So far, only typed patterns an dunapply had GADT matching. i1737.scala shows that we need to do the same thing for objects.
* | More info when unpickling failsMartin Odersky2016-11-241-2/+2
| |
* | Revert fix to #1701.Martin Odersky2016-11-242-6/+11
|/ | | | | | | | | | | Fengyun's original solution was the right one. We cannot NOT enter a package class into its parent scope, because reloading the denotation with .member will fail. So we need to enter it and compensate by adding a clause to `qualifies` in `typedIdent`. Weirdly, this was noted only when running tasty_bootstrap from a custom classpath in the new build setup. So it was pretty tricky to diagnose.
* TreeUnpickler: Workaround cyclic reference involving self-typeGuillaume Martres2016-11-221-2/+6
| | | | | | Special-casing like this is ugly, we should decide whether we want to avoid simplifications on all TypTrees and whether we want to do this just in unpickler or always. But I want to merge this PR first.
* Properly unpickle This trees without qualifierGuillaume Martres2016-11-221-1/+1
| | | | | Otherwise, they may end up with a qualifier, this manifested itself as a pickling difference in `tasty_tools`.
* ExtractDependencies: correctly record inheritance on type aliasGuillaume Martres2016-11-221-1/+1
| | | | | | | | | | | | This fix the test "Extracted source dependencies from public members" which previously failed with: Set('G, 'E) is not equal to Set('B, 'E) (DependencySpecification.scala:34) `H` extends `G.T[Int]` which is an alias of `B`, so the `topLevelInheritanceDepndencies` of `H` should contain `B`, this was not the case before because we didn't dealias before looking for the top-level class of the dependency, so we ended up with `G`, the top-level class in which the alias `T` is contained.
* Do not force symbols of annotations when unpicklingGuillaume Martres2016-11-222-12/+18
| | | | | | | | | | | | This lead to stale symbol errors in `tasty_tools` because the symbol forcing was bringing forward symbols from the previous run before the corresponding symbols for the current run were created. We fix this by adding Annotations#deferredSymAndTree which behaves similarly to Annotations#deferred but take a by-name symbol. We also remove TreeUnpickler#LazyAnnotationReader which was apparently never used.
* Workaround last issue with -Ytest-picklerGuillaume Martres2016-11-221-1/+1
| | | | | | | We run checkNoPrivateLeaks in the unpickler since last commit and this is causing an issue related to privacy leaks. Give up and workaround it since we're going to redesign how we handle privacy leaks because of https://github.com/lampepfl/dotty/issues/1723 anyway.
* checkNoPrivateLeaks is now also done in TreeUnpicklerGuillaume Martres2016-11-222-0/+8
| | | | | This could be abstracted better but we'll end up replacing checkNoPrivateLeaks soon anyway due to https://github.com/lampepfl/dotty/issues/1723
* checkNoPrivateLeaks: handle defs in local classesGuillaume Martres2016-11-221-1/+1
| | | | | | The access boundary of a def in a local class is the owner of that class, previously it was set to the access boundary of the owner of the class instead.
* checkNoPrivateLeaks: handle references to companion membersGuillaume Martres2016-11-221-2/+16
| | | | | | | | | | | Previously Outer2#Inner#foo failed to compile with: ``` non-private method foo refers to private value x in its type signature ``` This should compile because the boundary of `foo` is `class Outer2` and the boundary of `x` is `object Outer2`. This commit fixes this by also considering the linked boundary in `checkNoPrivateLeaks`.
* TreeUnpickler: Add missing case for ENUMconstGuillaume Martres2016-11-221-0/+2
|
* -Ytest-pickler: avoid forcing anything when there's a differenceGuillaume Martres2016-11-221-1/+1
| | | | | This might cause a stale symbol exception and make it harder to find the source of the problem.
* -Ytest-pickler: homogenize template body output orderGuillaume Martres2016-11-221-1/+14
|
* TypedTreeCopier#Select: don't use unstable prefixesGuillaume Martres2016-11-221-1/+1
| | | | | | | | | This manifested itself as a pickling difference in tasty_tools Note that there are probably more issues in this method, in particular the old type is reused when `qualifier.tpe eq tree.qualifier.tpe` even if the `name` is different. But I'm only trying to get the tests to pass for now.
* Fix flags for default getters of constructorsGuillaume Martres2016-11-222-1/+9
| | | | This manifested itself as a pickling difference in tasty_tools