aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/printing
Commit message (Collapse)AuthorAgeFilesLines
...
| * Add printing of type lambda treesMartin Odersky2016-07-111-4/+11
| | | | | | | | | | Also fix printing of variances in typedefs and params; they were suppressed before.
| * Introduce recursive typesMartin Odersky2016-07-111-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * Better printing of skolemsMartin Odersky2016-07-111-2/+1
| | | | | | | | | | | | | | | | | | | | They not print similar to scalac: "?x" where `x` is a unique number. Todo: An offline explanation what they are, similar to javac. I.e. ... ?3 ... where ?3: T
| * Allow general recursion in refined types.Martin Odersky2016-07-112-2/+2
| | | | | | | | | | Treat parent like refinedInfo. Introduce isBinding convenience method in TypeBounds.
* | Fix: #1375, Infinite loop in interpreterCsongor Kiss2016-07-121-4/+9
|/
* Fix #1292: give position when failing to emit switch on annotated matchFelix Mulder2016-06-021-8/+11
| | | | | | | | | | | | | | | | This fix gives the position and refactors the code that gave off warnings, but it also begs the question - should we be able to handle emitting a switch for the following case: ```scala (x: @switch) match { case 'a' if somePredicate(x) => // ... case 'b' => // ... } ``` Currently if there is a guard, the patternmatcher will fail to emit a switch. Scalac can handle these cases currently.
* Ignore LazyRefs in Tasty pickling comparisonsMartin Odersky2016-05-231-0/+2
| | | | This came up when tasty-checking Eq.scala.
* Fix keywords sometimes not highlighted in multilnFelix Mulder2016-04-291-2/+2
| | | | | When enter pressed immediately after keyword, the highlighting would be aborted
* Add Ammonite's MIT licenseFelix Mulder2016-04-291-0/+262
|
* 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.
* | Move Mode to coreMartin Odersky2016-04-011-1/+0
|/ | | | | Mode is used from a lot of low-level code, does not just reflect Typer info. So it makes more sense top to place it in the core package.
* 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
|
* Fix two private leaks in dotty compiler itself.Martin Odersky2016-02-191-2/+2
|
* Do not use the plain printer with -YdebugGuillaume Martres2016-02-061-1/+1
| | | | | | Instead, a new setting called -Yplain-printer is used for this. After this commit, we can now run all tests with -Ydebug (this was not the case before because using the plain printer breaks -Ytest-pickler)
* Hide stack traces behind -YdebugGuillaume Martres2016-02-051-1/+1
| | | | | | | | | They're not very useful for end users and some tests like tests/neg/selfreq.scala always print these exceptions which makes it harder to read the test logs, Also use Thread.dumpStack() instead of creating an Exception and calling printStackTrace() on it.
* Print bounds of TypeVars only when option is enabled.Martin Odersky2015-12-151-1/+2
|
* Improve printing of overloaded denotationsMartin Odersky2015-12-141-1/+1
|
* Fix tasty test failuresMartin Odersky2015-12-061-4/+4
| | | | by bringing homogenization of # $Apply projections back.
* Fix printing of type lambdasMartin Odersky2015-12-061-9/+26
|
* Don't recognize type bounds as lambda abstractionsMartin Odersky2015-12-061-5/+6
| | | | Printing bounds omits the "<:" otherwise.
* 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-062-79/+34
|
* 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.
* Swap order of arguments in annotationsMartin Odersky2015-11-221-1/+1
| | | | | | | | | The fact that the annotation comes first is weird, because when I write an annotated type it's <type> @<annotation>. Also, annotated types are like RefinedTypes in that they derive from a parent type. And in RefinedTypes the parent comes first. So swapping the arguments improves consistency.
* First versions of Definitions based on TypeRefs not Symbols.Martin Odersky2015-11-092-5/+5
| | | | | | | | | | | | | | | 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.
* Replace withMode by addModeMartin Odersky2015-10-011-1/+1
| | | | | | withMode sets the whole mode, nit an individual bits. This was used wrongly in several places. Make this less of a trap by renaming withMode -> withModeBits.
* 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.
* Put proper parentheses around complex widened types of singletons.Martin Odersky2015-07-061-1/+1
| | | | | In the type `(A & B)(C.this)`, the first parens were missing, so the type displayed as A & B(C.this), which is confusing.
* Avoid double context creation when modes change on a fresh context.Martin Odersky2015-06-221-1/+1
| | | | | | | | | | | | | | | | | | | | Move addMode and friends to two decorators, one for Context, the other for FreshContext. Implement behavior accordingly. This avoids creating two contexts in situations like: c.fresh.setxploreTyperState.addMode(...) Mow we can write c.fresh.addMode(...).setExploreTyperState Because addMode returns a fresh context when applied to a fresh context. Note that we specifically do not want virtual dispatch of addMode, that's why it was moved to a decorator. Also: removed mention of ".fresh: when just forllowed by an addMode, because that one is redundant.
* 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-192-2/+3
| | | | | | | 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.
* Better printing of skolem typesMartin Odersky2015-06-061-2/+2
|
* Split RefinedThis and SkolemTypeMartin Odersky2015-06-062-6/+5
| | | | | | | 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.
* Harden display logicMartin Odersky2015-05-211-1/+6
| | | | | Displaying stuff should never report an exception or cause more messages to be displayed that relate to the displaying.
* Show LazyRefs nicelyMartin Odersky2015-05-211-0/+2
| | | | Previously, this fell back to toString
* Specialize printing of Lambda abstractions.Martin Odersky2015-05-211-1/+76
| | | | | | | | Use the proposed Lambda syntax [HK$0, ..., HK$n] => body for them.
* Add "Printing" modeMartin Odersky2015-05-211-1/+2
| | | | | | | | | | | Idea: when printing, we should be more lenient about conditions that would otherwise cause an assertion failure, because we want to avoid triggering further assertions while diagnosing previous errors. As a start we generalize an assertion that RefinedTypes cannot be created after erasure. This gets triggered when playing around with printing lambdas at erasure time (see following commit): erasure runs at phase erasure + 1, so ctx.erasedTypes is true, but we might still want to print lambdas then, and printing lambdas will create new refined types as of next commit.
* Fix printing of Constant(Claz), ie getClass[Claz]Dmitry Petrashko2015-05-081-5/+5
| | | | Previous scheme did not work after erasure.
* RefinedPrinter: Pretty-print ErasedValueTypeGuillaume Martres2015-05-011-0/+3
|
* Merge pull request #500 from dotty-staging/implement/i499Dmitry Petrashko2015-04-301-1/+3
|\ | | | | Implement/i499
| * Print ByNameTypeTrees in RefinedPrinterMartin Odersky2015-04-241-1/+3
| | | | | | | | Was missing before, ffell back to raw printing.
* | Merge pull request #495 from dotty-staging/refactor/SuperAccessorsDmitry Petrashko2015-04-281-1/+1
|\ \ | |/ |/| Refactor/super accessors
| * Unpickle ImportsMartin Odersky2015-04-221-1/+1
| | | | | | | | | | | | Was missing before. Needed a tweak in PlainPrinter for printing import symbol references (their denotation is not current after pickling, so they would have printed differently after and before pickling).