aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/transform/TreeChecker.scala
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* Add Inlined tree nodeMartin Odersky2016-10-021-0/+3
| | | | | | | | | ... 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.
* Drop tpd.modsDecoMartin Odersky2016-09-261-1/+0
| | | | Prefer to access directly via symbol.
* Eliminate SelectFromTypeTree from docsMartin Odersky2016-09-251-1/+0
|
* Drop PairMartin Odersky2016-09-251-3/+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-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.
* 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.
* Allow creating static initialisers.Dmitry Petrashko2016-06-071-1/+4
|
* Annotate repeated params with `case` flag to indicate that they are legalFelix Mulder2016-05-271-2/+10
| | | | | | | 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
* Rename Reporting#println -> Reporting#echoMartin Odersky2016-04-271-8/+8
| | | | | | | | | | There's a trap otherwise that, when in a class inheriting from Context (and with it Reporting) a call to println will go to this.println and therefore might not print at all, if the current context buffers messages. I lost a lot of time on this on several occasions when I scratched my head why a simple debug println would not show. Better avoid this in the future for myself and others.
* Fix #1167: Remove the magic from Arrays.newRefArray.Sébastien Doeraene2016-04-181-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | Previously, the method `Arrays.newRefArray` was one of the only 3 methods that are kept generic after erasure. This commit removes this magic, by making it take an actual `j.l.Class[T]` as parameter. Moreover, the methods `newXArray` all receive an actual body, implemented on top of Java reflection, which means that a back-end does not *have to* special-case those methods for correctness. It might still be required for performance, though, depending on the back-end. The JVM back-end is made non-optimal in this commit, precisely because it does not specialize that method anymore. Doing so requires modifying the fork of scalac that we use, which should be done separately. The JS back-end is adapted simply by doing nothing at all on any of the newXArray methods. It will normally call the user-space implementations which use reflection. The Scala.js optimizer will inline and intrinsify the reflective calls, producing optimal code, at the end of the day.
* Ycheck that all methods have method typeliu fengyun2016-04-151-1/+10
|
* Check Java classes are not used as objectsliu fengyun2016-04-041-0/+74
| | | | | | | | | | Following code should not pass Ycheck: import java.lang.Math val myMath: Math.type = Math myMath.sqrt(3.0) id(myMath)
* Move Mode to coreMartin Odersky2016-04-011-0/+1
| | | | | 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.
* More detailed reporting in TreeCheckerMartin Odersky2016-03-101-1/+4
| | | | ... when definitions are missing.
* Use Context#setReporter where possibleGuillaume Martres2016-02-051-2/+1
|
* Partest dotty non-bootstrapped.Dmitry Petrashko2016-01-131-1/+1
| | | | | | Needs to go in before https://github.com/scala/scala-jenkins-infra/pull/152 is deployed
* More info when TreeChecker failsMartin Odersky2015-11-091-1/+1
| | | | Now also provides compilation unit.
* Trying to get more diagnostics out of TreeCheckerMartin Odersky2015-11-091-0/+4
| | | | Again it dies without an exception trace. Is partest eating error output?
* Avoid overhead of generating symbol sets on each accessMartin Odersky2015-11-091-1/+1
| | | | | | 1) Have symbol sets cached per run 2) Use methods Denotation#isPrimitiveValueClass, Denotation#isNumericValueClass instead of calling contains directly on symbol sets.
* Shorten ctx.typerState.reporter to ctx.reporterMartin Odersky2015-10-261-1/+1
| | | | ... making use of method in `ctx`.
* 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.
* When unpickling, translate T* to Seq[T] unless it's a parameter type.Martin Odersky2015-08-221-2/+7
| | | | | | | | Dotty allows T* types only for parameter types of MethodTypes (and for repeated arguments); all other ocurrences have to be translated to the underlying type. TreeChecker now verifies that Ident and Select nodes never carry a repeated parameter type.
* Fix miniphase assembly.Martin Odersky2015-08-151-1/+1
| | | | | | | | There were two architectural errors here, which confused TreeTransforms and MiniPhases and which caused "NotDefinedHere" on transformFollowing: 1. TreeTransforms should not have idx fields, MiniPhases have them.2 2. TreeTransformers initialize arrays of MiniPhases not TreeTransforms.
* Merge pull request #735 from dotty-staging/ycheck-methodsodersky2015-08-041-0/+20
|\ | | | | Ycheck that methods defined in ClassInfo exist in tree.
| * YCheck that methods, fields and variables have names that are valid on JVM.Dmitry Petrashko2015-07-231-0/+9
| |
| * YCheck that all methods are defined in treeDmitry Petrashko2015-07-231-0/+11
| |
* | Relax Ycheck for labels after LabelDefsDmitry Petrashko2015-07-131-1/+2
|/ | | | | | | | LabelDefs reorders labels. As a result of reordering label-def defined inside other label-def could be lifted outside. LabelDefs doesn't update owner chains to represent this. Making treeChecker aware of this.
* Remove unused global rootsMartin Odersky2015-07-061-2/+0
| | | | Some global roots were pointing to shared mutable state but were never used.
* Partest 2/3: Compiler prints via context instead of printlnvsalvis2015-06-241-6/+6
|
* TreeChecker: check for absence of private abstract methods.Dmitry Petrashko2015-05-031-0/+3
|
* Fix spurious warnings in TreeChecker.Dmitry Petrashko2015-04-301-2/+1
|
* Make checkCompanion stable against future DefsDmitry Petrashko2015-04-161-1/+3
|
* Revert "Disable checking of presence of companion objects: forces to much."Dmitry Petrashko2015-04-161-3/+1
| | | | | | The problem was due to cycles in ExtensionMethod themselves. This reverts commit 1ce894e06a3a7b3ca64e62c1de515c2125e89343.
* Disable checking of presence of companion objects: forces to much.Dmitry Petrashko2015-04-151-1/+3
| | | | Triggers cycles in ExtensionMethods.
* Ycheck that companions do not disappear.Dmitry Petrashko2015-04-151-0/+12
|
* Ensure spaces after `if` in Dotty source.Dmitry Petrashko2015-04-091-2/+2
|
* Remove trailing spaces in Dotty source.Dmitry Petrashko2015-04-091-2/+2
|
* Make all Dotty source files end in newline.Dmitry Petrashko2015-04-091-1/+1
|
* Remove check for duplicates in module val names.Dmitry Petrashko2015-03-231-4/+0
| | | | They are not lifted and they are allowed.
* Fix Ycheck printing a lot of error about symbols that don't actually exist.Dmitry Petrashko2015-03-191-1/+1
|
* Avoid escaping pattern bound variablesMartin Odersky2015-03-181-2/+2
| | | | | | | ... by applying the same "ensureNoLocalRefs" logic we already apply to blocks. This change is necessitated by Pickling - escaping variables are not defined before being referenced. The change uncovered in turn problems in type avoidance.
* Tightening of orphans tests.Martin Odersky2015-03-181-0/+2
| | | | | Need to always follow TypeVariables, otherwise we will not detect orphan parameters of uninstantiated type variables.
* YCheck now checks symbols for validity.Dmitry Petrashko2015-03-171-1/+38
| | | | For now check if symbol was already defined and if classes have a valid superclass.
* Make TreeChecker a phaseDmitry Petrashko2015-02-191-1/+8
|
* Added test to TreeChecker that guards against orphan parameters.Martin Odersky2015-02-111-0/+19
| | | | | | | | | | | Currently, tests fail. The failures I checked are all related to tailcalls. Not sure whether there are others. This is a blocker for serialization. Orphan parameters cannot be serialized. Maybe rethink the position of tailcalls? It looks to me that the repeated trouble it gives us is more than the effort required to put an efficient tailcall recognition after pattern matching in place. But I might be wrong.
* 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.
* Fixed narrowLiftedOwner in LambdaLiftMartin Odersky2014-12-121-0/+7
| | | | | | | | A lot of cases were missing before and caused failures in the newly added test in TreeChecker#typedThis. Now we assure that all this references appear inside the referenced class.
* Show full name of doubly defined symbolsDmitry Petrashko2014-11-221-2/+2
|
* Allow checking that trees and their defined symbols have modifiers in sync.Dmitry Petrashko2014-11-221-2/+13
|