aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/typer/ReTyper.scala
Commit message (Collapse)AuthorAgeFilesLines
* Fix problem related to accessor generation under separate compilationMartin Odersky2016-10-021-0/+1
| | | | | | | Accessors were multiply generated under separate compilation. To fix this, the resident body of an inlined function is now the same as the inlined body. Both use accessors where necessary. Previously, only the inlined body used accessors.
* Harden ReTyper so that it's fit for inliningMartin Odersky2016-10-021-0/+11
| | | | | | | 1. Imlement typedUnapply 2. Disable implicit view searches and searches for equality checks - these should have already happened in the first typer run.
* Better diagnostics for TreeCheckerMartin Odersky2016-10-021-1/+2
| | | | | | | | 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.
* First version of inline schemeMartin Odersky2016-10-021-2/+2
| | | | | To be done: outer accessors To be done: error positions
* Get rid of SelectFromType tree node.Martin Odersky2016-09-251-6/+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.
* Annotate repeated params with `case` flag to indicate that they are legalFelix Mulder2016-05-271-0/+1
| | | | | | | 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
* Add second field to SeqLiteralMartin Odersky2016-03-101-1/+1
| | | | | | | 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.
* More refined Retyping tracingMartin Odersky2015-11-091-3/+4
| | | | | | Instead of simply dropping all Retyper error traces, we now send them to the config.Printers.transforms printer, so what happens depends on the value of that printer.
* Disable "Exception while typing" trace in retyper.Martin Odersky2015-11-091-2/+2
| | | | | | I looked a some of the failures so far, and in each case we got a huge "exception while typing" cascade but then no actual error! Buffer overflow? To find out more I disabled the trace for now.
* Fix oversight causing a type error on build.Martin Odersky2015-06-191-3/+1
|
* Make all Dotty source files end in newline.Dmitry Petrashko2015-04-091-1/+1
|
* Replace Throwable catches with NonFatalMartin Odersky2014-12-151-1/+2
| | | | | | Previously, stackoverflows led to infinite loops because the catch immediately threw another stack overflow. Anyway, one should never catch Throwable.
* Drop modifiers as separate data from MemberDef treesMartin Odersky2014-11-101-2/+3
| | | | Typed MemberDef trees now take the modifiers from their symbol's data.
* Better tests and bugfix for named argsMartin Odersky2014-10-261-2/+2
| | | | | | | | | | | | | | | | | | | | The original problem was that in an expression f(x = bar(y = z)) only the outer named arg was eliminated by FirstTransform. The first error was that the postcondition in FirstTransform did not get to the named arg, because it got called from the overrdden typed method in TreeChecker, yet function arguments were evaluated with typedUnadapted. action: change Retyper and TreeChecker to override typedUndapped instead of typed. This flushed out the second error: transformOther in FirstTransform needs to recursively transform the argument of a NamedArg, because the framework itself does not handle NamedArg nodes. Now, all tests pass except that TreeChecker itself fails -Ycheck:gettersSetters due to a problem with handling by-name function types. This should be fixed in a separate PR.
* SuperTypes are now promoted in Retyper; lambdaLift fails to Ycheck otherwise.Martin Odersky2014-10-261-0/+3
|
* Fix tree typing to account for trees after constructors is run.Martin Odersky2014-10-111-0/+3
|
* Move crash diagnostics from TreeChecker to ReTyper.Martin Odersky2014-09-041-0/+8
| | | | | If there's a crash, we always want to see where the retyper was, not just for tree checking.
* Completed outer paths.Martin Odersky2014-09-011-1/+1
| | | | | | | Outer paths, parameters and arguments are inserted in erasure, using methods provided by OuterAccessors. Also fixed a stupid bug in Erasure#constant
* Types of This trees are promoted during retyping.Martin Odersky2014-08-311-0/+3
| | | | | | | | | Failing to do this leads to problems when retyping the This of nested classes with the same name (e.g. nested anonymous classes as they appear in t0453.scala). RefinedPrinter was changed to avoid sugaring of anonymous classes when uniqid is set (that was essential to track down the problem).
* Moving an assertion from erasure to TreeChecker.Martin Odersky2014-08-301-1/+1
| | | | The move caught an illegal erased type in a SelectFromType node.
* Enabling primitive operations in ReTyperMartin Odersky2014-08-281-0/+8
| | | | | | | The idea is that primitive operations do not have a symbol, but when applied have directly a MethodType. Such operations will be generated in Erasure for array ops. The patch allows retyping of such operations.
* Disable enclding in retyping.Martin Odersky2014-08-281-1/+3
| | | | | We would like to be able to define unencoded symbolic names in trees computed by the compiler. The patch avoids their accidental encoding.
* Override symbolOfType in ReTyper.Martin Odersky2014-08-241-0/+1
| | | | | So far, not needed, but is a reasonable precaution because the original implementation of symbolOfType makes no sense for Retyper.
* Restrict treee copiers with default arguments to trees with more than 2 ↵Martin Odersky2014-08-131-3/+3
| | | | | | | elements. It's not really an abbreviation to do it for trees with fewer elements and it leads to unncessessary syntactic variation.
* Switched to new cpy scheme.Martin Odersky2014-08-131-3/+3
| | | | Avoid mentioning arguments that are unchanged.
* Changes to tree copyingMartin Odersky2014-08-131-3/+3
| | | | | | | | 1) Add copiers with default arguments, to avoid boilerplate 2) All copiers are now curried wrt first argument (which is the original tree). We already make use of the new features in cpy.DefDef, but not yet elsewhere.
* Added elimLocals miniphaseMartin Odersky2014-08-031-0/+2
| | | | | | | This phase drops the Local flag from all private[this] and protected[this] members. This allows subsequent code motions where code is moved from a class to its companion object. It invalidates variance checking, which is consequently disabled when retyping.
* Fixes to ReTyperMartin Odersky2014-07-171-4/+11
| | | | | | | | 1) Disabled insertApplyOrImplicit - it leads to untyped trees which cause assertion errors down the road. In any case, neither apply methods nor implicits can be inserted when retyping. 2) Avoid copying tree annotations into symbols when retyping.
* Tightening of rules for explicit types for implicit defsMartin Odersky2014-05-081-2/+0
| | | | | | | | | | | | 1) We now demand that all implicit defs have an implicit type, not just class members. If we admitted implicit term members without explicit types, the rules and algorithms for dteremining eligible implicits would be greatly complicated (because there's always the danger that inferring the type by typechecking the rhs causes a cyclic reference). 2) We check for violations of this rule earlier, during type completion, in order to avoid cyclic references happening before we do the check.
* Avoid retyping of LiteralsMartin Odersky2014-05-081-0/+3
| | | | | | | | | | Literals need to be promoted as is, because constant folding might have changed the type of the literal to the expected type. E.g. in val x: Byte = 2 The literal 2 will have type `Byte(2)` but its underlying constant will still be `Int(2)`. So re-typing would give the wrong type.
* Avoid checking for tpt non empty in implicit defs after typer.Martin Odersky2014-05-081-1/+4
| | | | | The check assumes that inferred TypeTrees do not exist yet, but after the typer they do exist.
* Avoid creating a local dummy when retyping.Martin Odersky2014-04-081-1/+3
| | | | Retyping should not create new symbols and that includes local dummys.
* Factored re-typing logic into seperate ReTyper classMartin Odersky2014-03-311-0/+56
Refactored re-typing logic from erasure into seperate ReTyper class. Another candidate subclass of ReTyper is a future TreeChecker.