aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/transform
Commit message (Collapse)AuthorAgeFilesLines
* CleanupsMartin Odersky2016-10-021-2/+1
| | | | | Better comments and refactorings that move some things around so that less modules depend on Inliner.
* Drop annotations from dealiasMartin Odersky2016-10-021-1/+1
| | | | | | | | | | | | We got an error when we tried t opur @inline annotations on function parameter types. It turned out that there were lots of places where annotations on a type would break a test in the compiler. So we now drop annotations by default when dealiasing. We provide dealiasKeepAnnots as an alternative that has the old behavior, i.e. rewrap annotations after dealiasing. The only place where we found we needed this was in the exhaustivity checker.
* Fix ExplicitSelf phaseMartin Odersky2016-10-021-2/+3
| | | | | | | | | | | | | | After inlining we got a Ycheck error of the form: found : `this.asInstanceOf[SelfType].C` expected: `this.C` The fact that it was related inlining was coincidental I think. We fix the problem by expanding to this.asInstanceOf[SelfType & this.type].C instead.
* Handle Inlined blocks on ElimErasedValueTypeMartin Odersky2016-10-021-0/+3
|
* Better diagnostics for TreeCheckerMartin Odersky2016-10-021-2/+3
| | | | | | | | 1. Better formatting in TreeChecker error message 2. Re-enable printing what stack of what was checked when an error occurred. This was disabled in Retyper because we did not do it for the Inliner typer. Now we distinguish on phase instead.
* Handle outer this in InlinerMartin Odersky2016-10-024-3/+10
| | | | Also, do some refactorings and fix some bugs in Inliner.
* Set the positions of inlined trees wehn read form TastyMartin Odersky2016-10-021-2/+3
| | | | | | | | | | | This required a major change in the way positions are handled, as the previous scheme did not allow to read the positions of arbitrary subtrees selectively. Fortunately, it's altogether a major simplification. Also, this fixed a bug in the previous scheme, where positions were generated before compactification, resulting in addresses being wrong.
* Track Inlined nodes in ctx.sourceMartin Odersky2016-10-021-0/+15
|
* Add Inlined tree nodeMartin Odersky2016-10-022-1/+34
| | | | | | | | | ... 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.
* Make Context#moreProperties strongly typedMartin Odersky2016-10-021-2/+2
| | | | To do this, factor out Key from Attachment into a new type, Property.Key.
* First version of inline schemeMartin Odersky2016-10-021-0/+4
| | | | | To be done: outer accessors To be done: error positions
* Drop tpd.modsDecoMartin Odersky2016-09-262-4/+3
| | | | Prefer to access directly via symbol.
* Eliminate SelectFromTypeTree from docsMartin Odersky2016-09-251-1/+0
|
* Get rid of Thicket(List(...)) as an expressionMartin Odersky2016-09-251-4/+4
| | | | Thicket has a vararg constructor, so this syntax is redundant.
* Get rid of SelectFromType tree node.Martin Odersky2016-09-252-32/+0
| | | | | | 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-252-32/+0
| | | | | | | | 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.
* Swap order of elements in AnnotatedMartin Odersky2016-09-243-4/+4
| | | | | | | | | 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.
* Merge pull request #1534 from OlivierBlanvillain/clean-up-printersFelix Mulder2016-09-231-1/+1
|\ | | | | Clean up config.Printers imports
| * Clean up config.Printers importsOlivier Blanvillain2016-09-231-1/+1
| | | | | | | | And remove the not used Printer#echo
* | Fix select staticMartin Odersky2016-09-191-14/+10
| | | | | | | | | | | | Need to do time travel to find out whether members were created as static symbols. After LambdaLift and Flatten most symbols are static anyway.
* | Fix corner case w types ALL passed by name & out of orderOlivier Blanvillain2016-09-161-5/+2
|/ | | | | | | | This commit removes a problematic duplicated `checkBounds` call on `TypeApply`. To verify correctness of this change on has to check that `normalizeTree` used only once [1], and the function using `normalizeTree` already takes care of calling `checkBounds`. [1]: https://github.com/lampepfl/dotty/blob/0e8f05d88bfef95fac59f522fd9d06792126bd11/src/dotty/tools/dotc/transform/PostTyper.scala#L205
* Fix #1335: Generate null checks for extractorsOlivier Blanvillain2016-09-081-3/+7
|
* Identation/spacing cleanupOlivier Blanvillain2016-09-081-78/+72
|
* Fix #1490: type test of union types via type aliasliu fengyun2016-09-011-1/+1
|
* Merge pull request #1461 from dotty-staging/fixes-gadtsodersky2016-08-261-1/+1
|\ | | | | Fixes of GADTs and test recategorization.
| * Fix testing in tree checker.Martin Odersky2016-08-261-1/+1
| | | | | | | | | | | | | | Tree checker typed always dropped the expected type and replaced it by a wildcard. This meant that type checking dor -Ycheck was much weaker than it should be. A class of GADT problems is only diagnosed once the expected type is proberly propagated.
* | Fix a couple of warnings.Nicolas Stucki2016-08-262-4/+5
|/
* implementation of exhaustivity and redundancy checkliu fengyun2016-08-244-9/+640
|
* Fix #1444: Add implicit arguments to supertraitsMartin Odersky2016-08-201-9/+10
| | | | | | | | If a super trait is given as a type (i.e. no argument list), implicit args were not passed. This is fixed now. Also, we now check for parameterized traits lacking type arguments in Typer instead of in Mixin. Fixes #1444.
* New string infterpolatorsMartin Odersky2016-08-164-19/+18
| | | | | | 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.
* Merge pull request #1445 from dotty-staging/fix-#1442Dmitry Petrashko2016-08-151-0/+60
|\ | | | | Fix #1442: add new phase, SelectStatic
| * SelectStatic: do not promote types-qualifiers.Dmitry Petrashko2016-08-091-1/+1
| |
| * SelectStatic: retain symbols on overloaded selectsDmitry Petrashko2016-08-091-2/+1
| |
| * SelectStatic: also normalise TypeApply nodes.Dmitry Petrashko2016-08-091-0/+6
| |
| * SelectStatic: do not create blocks that are qualifier of select\applyDmitry Petrashko2016-08-091-11/+27
| | | | | | | | | | | | | | | | | | Blocks are not denoting trees(why aren't they?) For now, I'm fixing this using a quick fix. For future, it may make sense to discuss this on dotty meeting and make blocks be a Denoting tree and return denotation of expo. Another option is to move regularisation logic into tree transformers.
| * Fix SelectStatic: do not lift java statics to free idents.Dmitry Petrashko2016-08-091-1/+3
| |
| * Fix NoDenotation.owner in SelectStatic.Dmitry Petrashko2016-08-091-3/+3
| |
| * Fix #1442: add new phase, SelectStaticDmitry Petrashko2016-08-091-0/+37
| | | | | | | | | | | | | | | | GenBCode has an implicit assumption that I wasn't aware of: GetStatic should not be emitted against a valid selector. If it is, GenBCode messes up the stack by not pop-ing the selector. Surprisingly, this transformation is perfumed in nsc by flatten.
* | Merge pull request #1414 from dotty-staging/add-array-strawmanodersky2016-08-142-8/+11
|\ \ | |/ |/| Add arrays to collection strawman
| * Fix problem related to cbn parameters in supercallsMartin Odersky2016-07-272-8/+11
| | | | | | | | | | | | | | | | | | | | | | The closures generated by elimByName did not get the InSuperCall flag set. This caused problems in lambda lift which led to a verify error for the new version CollectionStrawMan6. That version replaces explicit function parameters in class LazyList by by-name parameters. Also: Clarify logic for liftLocals in LambdaLift (liftLocals caused the immediate problem but was in the end not to blame).
* | Merge pull request #1398 from dotty-staging/fix-#1269Dmitry Petrashko2016-07-311-2/+1
|\ \ | | | | | | Fix #1269: Typing and pattern matching of nested subclasses
| * | Fix outer test in pattern matcherMartin Odersky2016-07-171-2/+1
| |/ | | | | | | | | Previous test did not reflect deeper paths for outer references. This caused a -Ycheck:patMat failure for i1269.scala.
* | Merge pull request #1410 from dotty-staging/fix-#1263Dmitry Petrashko2016-07-281-7/+7
|\ \ | | | | | | Fix #1263: Suppress super initializer call for val parameters of traits.
| * | Fix #1263: Suppress super initializer call for val parameters of traits.Martin Odersky2016-07-221-7/+7
| |/ | | | | | | | | | | | | Val-parameters of traits don't have an initializer, as other vals do. So we cannot call the initializer in an initialization sequence of a subclass. Fixes #1263.
* | Merge pull request #1289 from dotty-staging/fix/partest-separateGuillaume Martres2016-07-272-2/+13
|\ \ | | | | | | partest: Enable separate compilation
| * | Don't generate outer accessors for Java innner classes.Martin Odersky2016-07-271-1/+1
| | | | | | | | | | | | Java's naming convention is different from Scala's.
| * | Make private accessor in value class not-private.VladimirNik2016-07-271-1/+12
| |/ | | | | | | | | This is necessary to unbox the value class when accessing it from separate compilation units
* / fix #1354: improve type test and typecast of union typesliu fengyun2016-07-261-8/+23
|/
* Merge pull request #1343 from dotty-staging/change-hk-direct2odersky2016-07-155-18/+24
|\ | | | | Direct representation of higher-kinded types
| * Drop Config.checkKindsMartin Odersky2016-07-112-2/+3
| | | | | | | | | | Allows us to drop also the involved knownHK method. Lots of other cleanups.