aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/printing/RefinedPrinter.scala
Commit message (Collapse)AuthorAgeFilesLines
* Juggling with close in RefinedPrinterMartin Odersky2016-10-021-10/+7
| | | | | | Because of different close seqences before and after pickling we could get spurious differences, where in one file things were put on one line, and in the pther there was a linebreak.
* Fix problem with homogenize treesMartin Odersky2016-10-021-1/+1
|
* Drop Inlined when homogenizeMartin Odersky2016-10-021-2/+7
| | | | Pickler drops Inlined nodes, so homogenize needs to do the same.
* Add Inlined tree nodeMartin Odersky2016-10-021-0/+2
| | | | | | | | | ... to tag inlined calls. Perform typings and transformations of inlined calls in a context that refers to the INlined node in its InlinedCall property. The idea is that we can use this to issue better error positions. This remains to be implemented.
* Eliminate tpd.Modifiers.Martin Odersky2016-09-261-1/+6
| | | | | | Backend does not need them after all, can just use nulls there. So the functionality is only used for printing, and it makes sense to move everything there.
* Drop tpd.modsDecoMartin Odersky2016-09-261-2/+4
| | | | Prefer to access directly via symbol.
* Get rid of SelectFromType tree node.Martin Odersky2016-09-251-3/+2
| | | | | | Roll its functionality into Select. Since we can always tell whether a tree is a type or term there is no expressiveness gained by having a separate tree node.
* Drop PairMartin Odersky2016-09-251-3/+1
| | | | | | | | Drop tree node class 'Pair'. It was used only in imports, where it can easily be replaced by Thicket. The envisaged use for generic pairs is almost sure better modelled by a "Pair" class in Dotty's standard library.
* Make InterpolatedString conform to ordering requirementMartin Odersky2016-09-241-8/+6
| | | | Arrange its sub-elements so that they appear strictly left to right.
* Swap order of elements in AnnotatedMartin Odersky2016-09-241-1/+1
| | | | | | | | | Now it's annotated first, annotation second. This is in line with AnnotatedType and in line with the principle that tree arguments should come in the order they are written. The reason why the order was swapped before is historical - Scala2 did it that way.
* Make positions fit for metaMartin Odersky2016-09-241-0/+1
| | | | | | | | | | | | | | | | | | In particular: - get rid of envelope, it's too complicated and hides too many errors - check that everywhere in parsed trees the position range of a parent node contains the position ranges of its children. - check that all non-empty trees coming from parser have positions. The commit contains lots of fixes to make these checks pass. In particular, it changes the scheme how definitions are positioned. Previously the position of a definition was the token range of the name defined by it. That does obviously not work with the parent/children invariant. Now, the position is the whole definition range, with the point at the defined name (care is taken to not count backticks). Namer is changed to still use the token range of defined name as the position of the symbol.
* Don't omit scala. from fullNameString.Martin Odersky2016-08-161-1/+1
| | | | | | | The previous fix was too drastic, as it would also have omitted scala, Prefef and other "unqualified owner types" from full names. We now omit only "empty prefixes", i.e. roots, anonymous classes and repl qualifiers.
* Don't print $ suffixes of module classesMartin Odersky2016-08-161-1/+4
| | | | ... when printing using RefinedPrinter. PlainPrinter will still show them.
* Don't print REPL prefixes.Martin Odersky2016-08-161-0/+4
| | | | | This was already disabled when printing types. Now is also disabled when printing fully qualified names.
* New string infterpolatorsMartin Odersky2016-08-161-2/+2
| | | | | | Roll `sm` and `i` into one interpolator (also called `i`) Evolve `d` to `em` interpolator (for error messages) New interpolator `ex` with more explanations, replaces disambiguation.
* Tweaks to printingMartin Odersky2016-07-211-1/+1
| | | | | - increase page width - print scopes more legibly under -verbose
* Refine printing of tuple an function types with wildcardsMartin Odersky2016-07-191-3/+3
|
* Fix bug in printing untyped New nodes.Martin Odersky2016-07-111-1/+5
| | | | Printed as <notype> before.
* Remove refinement encoding of hk typesMartin Odersky2016-07-111-30/+0
| | | | | | | | | | Remove the code that implemented the encoding of hk types using refinements. Drop the notion that RefinedTypes can be type parameters. This is no longer true under the new representation. Also, refactoring MemberBinding -> TypeParamInfo
* Fixes for printing under -Ytest-picklerMartin Odersky2016-07-111-1/+1
| | | | | | | | | | - Make printing package ids more robost Crashed before when printers were turned on during test pickling mode. - Make Denotation#bringForward more robost Assertion failed before when printers were turned on during test pickling mode.
* Fix printing of type lambda trees and typesMartin Odersky2016-07-111-1/+3
|
* Start new, direct HK schemeMartin Odersky2016-07-111-26/+3
| | | | | - Re-introduce newHK option. Label some things that will be removed with OLD.
* Remove old hk schemeMartin Odersky2016-07-111-3/+1
| | | | | | | | | | | | - Simplify RefinedType - Drop recursive definition of RefinedThis - this is now taken over by RecType. - Drop RefinedThis. - Simplify typeParams The logic avoiding forcing is no longer needed. - Remove unused code and out of date comments.
* Multiple fixesMartin Odersky2016-07-111-2/+5
| | | | | | | | | | | | | | | | | | | | | | | - Swap order of tests in lookupRefined - Change joins of BindingKinds. A type parameter joint with a normal refinement represents a type parameter that has been filled in. So the Binding attribute should be removed. - Fix printing of type lambdas under new hk scheme - refine isRef for hk type The new definition avoids that a higher-kinded type "isRef" of an underlying class. I.e. `[X] -> Any` is not longer a ref to `Any`. - Fix withBindingKind for type aliases Old definition converted aliases to type bounds. - Multiple fixes to BetaReduce - Fix logic for hk subtype tests - Make isHK more precise
* Turn on new hk schemeMartin Odersky2016-07-111-1/+2
| | | | | | | For the moment under newHK flag. - avoid crasher in derivedTypeParams (NamedTypes don't always have symbols) - Revise logic in type comparer for new HK scheme
* Add printing of type lambda treesMartin Odersky2016-07-111-4/+11
| | | | | Also fix printing of variances in typedefs and params; they were suppressed before.
* Allow general recursion in refined types.Martin Odersky2016-07-111-1/+1
| | | | | Treat parent like refinedInfo. Introduce isBinding convenience method in TypeBounds.
* Merge pull request #1186 from dotty-staging/fix-#1185odersky2016-04-061-1/+1
|\ | | | | Improvements to cyclic checking, avoidance, named parameters
| * Fix bug in printing New nodesMartin Odersky2016-03-301-1/+1
| | | | | | | | Explicitly given type parameters were printed twice.
* | Make erased value type take a TypeRef instead of a ClassSymbolMartin Odersky2016-04-031-2/+2
|/ | | | To address #1198, we need to avoid putting symbols in ErasedValueTypes.
* Add second field to SeqLiteralMartin Odersky2016-03-101-2/+2
| | | | | | | The field keeps track of the element type. This is necessary because JavaSeqLiteral is nonvariant and the elements might be empty, so we cannot always compute the type from the element types.
* Rename AllFlags to AnyFlagsGuillaume Martres2016-03-011-1/+1
| | | | | | `membersBasedOnFlags(requiredFlags = AnyFlags, excludedFlags = ...)` is easier to understand than `membersBasedOnFlags(requiredFlags = AllFlags, excludedFlags = ...)`
* Merge parentsWithArgs and instantiatedParentsMartin Odersky2016-02-191-1/+1
|
* Improve printing of overloaded denotationsMartin Odersky2015-12-141-1/+1
|
* Fix printing of type lambdasMartin Odersky2015-12-061-9/+26
|
* Fix problem with printing lambdas.Martin Odersky2015-12-061-3/+4
| | | | | Previous implementation died because TermRef had no denotation.
* Use typeapp extractors for printingMartin Odersky2015-12-061-77/+28
|
* Add missing type params in testMartin Odersky2015-12-061-2/+2
|
* Drop argumnt interpolation.Martin Odersky2015-11-301-1/+1
| | | | | | | It turns out it's not needed because now all type arguments are expressed as aliases. Interestingly dropping this feature shaved 20% off the time off junit tests. Which seems to indicate that the handling of type application is really performance critical.
* First versions of Definitions based on TypeRefs not Symbols.Martin Odersky2015-11-091-2/+2
| | | | | | | | | | | | | | | Symbols are not stable between runs, so if some symbol referred to from Definitions gets recompiled, there are then two Symbols that are both visible, one referenced from Definitions, the other the one that got compiled. Thos led to a crash when e.g. compiling scala.Short, because the newly compiled symbol was not recognized as a primitive value class. The present commit tries to make systematic changes without regard to simplicity or aesthetics. This will be polished in future commits. // ### comments signal areas that need further attention.
* Avoid printing expanded names when displaying type parameters.Martin Odersky2015-10-301-6/+5
| | | | | Differences can be observed when checking neg/variances.scala. Review and any necessary polishing by @smarter.
* Rename Apply -> hkApplyMartin Odersky2015-09-181-4/+4
| | | | Want to have a unique name for Apply, so that tests for higher-kinded types become cheaper.
* Insert a space between symbol and `:' when printing SelectionProtosMartin Odersky2015-06-221-1/+2
| | | | | Previously, we'd see something like `? { :+: Int }`, which is confusing. Now we see instead `? { :+ : Int }`.
* Don't keep SkolemTypes in TASTYMartin Odersky2015-06-191-1/+1
| | | | | | | SkolemTypes are no longer needed when Pickling because they exist only for checking type-safety. After the typer, we can safely eliminate them. Not having skolem types in TASTY simplifies the format and avoids having to explain a difficult concept.
* Split RefinedThis and SkolemTypeMartin Odersky2015-06-061-1/+1
| | | | | | | SkolemTypes need to behave differently form RefinedThis types in TypeMap and TypeAccumulator. For skolem types these should follow through to the underlying type. For RefinedThis types, these need to do nothing, in order not to start an infinite recursion.
* Make Mutable a ModifierFlag.Martin Odersky2015-06-011-1/+1
| | | | | | It definitely does appear in trees, so should be included in the set. Affects how things are printed. Before, typed var's would still show up as vals.
* Specialize printing of Lambda abstractions.Martin Odersky2015-05-211-1/+76
| | | | | | | | Use the proposed Lambda syntax [HK$0, ..., HK$n] => body for them.
* RefinedPrinter: Pretty-print ErasedValueTypeGuillaume Martres2015-05-011-0/+3
|
* Print ByNameTypeTrees in RefinedPrinterMartin Odersky2015-04-241-1/+3
| | | | Was missing before, ffell back to raw printing.
* Better homogenization.Martin Odersky2015-04-141-1/+4
| | | | Needed for next commit. Also homogenize types used in prefixes, and never drop "scala.", "Predef." in homogenized view.