aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/transform/TreeChecker.scala
Commit message (Collapse)AuthorAgeFilesLines
* 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
|
* #204 check for global uniqueness of definitions.Dmitry Petrashko2014-11-221-10/+19
| | | | | Check now fails after erasure. Should become error after fixed.
* Drop modifiers as separate data from MemberDef treesMartin Odersky2014-11-101-1/+1
| | | | Typed MemberDef trees now take the modifiers from their symbol's data.
* New miniphase: FlattenMartin Odersky2014-11-091-1/+1
|
* Merge commits '474b2ae' and '46eb5ea' from #201 into umasterDmitry Petrashko2014-11-031-1/+1
|\
| * Fix treatment of by name functionsMartin Odersky2014-10-271-1/+1
| | | | | | | | | | | | | | By-name functions like `(=> T) => T` were not treated correctly before. Witness the disabled `-Ycheck:gettersSetters` for transform/TreeCheckers in thge test suite. This commit changes the scheme how => T types are treated and fixes the problems with by-name functions.
* | Print whole TreeTransform name in Ycheck and XprintDmitry Petrashko2014-10-301-1/+3
|/
* Better tests and bugfix for named argsMartin Odersky2014-10-261-8/+18
| | | | | | | | | | | | | | | | | | | | 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.
* Enabled commented out testsMartin Odersky2014-10-261-2/+2
|
* Add missing and double symbol checking to TreeCheckerMartin Odersky2014-10-261-1/+45
| | | | | | | | TreeChecker now tests that a symbol does not have two definitions that define it, and that every reference to a symbol owner by a term is in the scope of a definition of that symbol. Both tests fail on several files for pattern matcher.
* More assertions in TreeChecker.Martin Odersky2014-10-261-5/+7
| | | | Flushed out a caching bug in Scopes.
* Adaptations to make pattern matcher in new worldMartin Odersky2014-10-121-2/+2
| | | | | | | | | | Tests now always include erasure (before quite a few tests failed when erasure was enableed). By contrast lazy vals creates problems with erasure, disabled for now. Some other small polishings on integration of pattern matcher with rest of dotc. Deep recompilation of tools still fails, currently disabled.
* Don't adapt to FunProto in TreeChecker.Martin Odersky2014-10-121-1/+2
| | | | | | Similar to Erasure, we do not check conformance wrt <:< to a FunProto. Nothing is lost, because we typecheck the arguments and result anyway. And this led to failing tests after GettersSetters was added.
* Fix tree typing to account for trees after constructors is run.Martin Odersky2014-10-121-0/+3
|
* After-rebase fix: weaken owner-chain restriction.Dmitry Petrashko2014-10-111-1/+1
| | | | Allow to skip labels.
* Fix tree typing to account for trees after constructors is run.Martin Odersky2014-10-111-5/+5
|
* Make changeOwner more robust regarding non-standard owner chainsMartin Odersky2014-10-111-6/+9
| | | | | | | | | | | The problem is running changeOwner(from, to) where - from is a ValDef or a Label - an embedded definition has as owner not `from` but some owner of `from`. We allow such denomrlaized owners and the pattern matcher generates them. This patch makes changeOwner take these situations into account.
* More accurate or postcondition conchecking in TreeCheckerMartin Odersky2014-09-241-1/+13
| | | | | | | Previous postcondition checking did not take into account that phases are not flat - they consist in part of macro phases that contain miniphases. In fact the whole set up in Run is dubiuos - we should eliminate the problem at the root, as described in the TODO in run.
* Patmat now succeeds tests.Dmitry Petrashko2014-09-231-2/+6
| | | | @odersky there are some tests disabled, which failed due to other phases being able to transform more code.
* Allow skipping Label's in owner chainsDmitry Petrashko2014-09-171-2/+3
|
* Fixes to TreeCheckerMartin Odersky2014-09-101-3/+3
| | | | | 1) One phase too many was checked for postconditions. 2) Class members did not have their owners checked because index was not called on them.
* Generalize phase postcondition checking.Martin Odersky2014-09-061-33/+6
| | | | | | | Have a general way how a phase can establish a postcondition which will be checked each time a later phase is tree-checked. Moves erasure constraints from TreeChecker to Erasure's post condition.
* Better tests and more fixes for ExplicitOuterMartin Odersky2014-09-061-1/+9
| | | | | | Now also testing that after erasure no outer this exists. Tests suit now includes calls to local classes and methods which need an outer pointer, as well as passing an outer pointer along a secondary constructor.
* Move crash diagnostics from TreeChecker to ReTyper.Martin Odersky2014-09-041-5/+1
| | | | | If there's a crash, we always want to see where the retyper was, not just for tree checking.
* Moving an assertion from erasure to TreeChecker.Martin Odersky2014-08-301-0/+12
| | | | The move caught an illegal erased type in a SelectFromType node.
* Ensure that after erasure all types are erased.Martin Odersky2014-08-301-1/+13
| | | | | Defines a predicate isErasedTypes and checks that all tree types and their widened underlying types are erased.
* Better error diadnostics in TreeChecker.Martin Odersky2014-08-281-1/+5
| | | | On type error, show the source line where the failure occured.
* ref(<type>) -> TypeTreeMartin Odersky2014-08-251-1/+1
| | | | | Taking the ref of a type should always give a TypeTree. Makes ref more universally usable as type references after frontend are assumed to be TypeTrees.
* Check that idents don't assume magic.Martin Odersky2014-08-241-4/+12
| | | | | | In TreeChecker, make sure that every identifier has a type with an elidable prefix. This excludes identifiers pointing to members of random prefixes without making the prefix explicit in the tree as part of a Select node.
* renaming: core.transform.Erasure -> core.TypeErasureMartin Odersky2014-08-241-1/+0
| | | | | | | The name duplications transform.Erasure / core.transform.Erasure caused irregularities in the imports and the smae name was confusing. Besides Erasure was the only class in core.transform, so it seemed better to eliminate the package alltogether.
* Extend owner checking in TreeCheckerMartin Odersky2014-08-181-7/+17
| | | | Now also checks owners of primary constructors and template local dummys.
* Disabling adapt in TreeCheckerMartin Odersky2014-08-171-0/+5
| | | | | | | | well-typed code should not need further adapations. That's why `adapt` is replaced by a subtype assertion in TreeChecker. Flushed out two instances where typechecking did not produce well-adapted trees - one in typedClosure, the other manifested itself in typedSuper.
* Moved -Ycheck after SplitterMartin Odersky2014-08-161-11/+6
| | | | | | | This required a change in Ycheck where we now only test that the new tree has a subtype of the old one. Previously the requirement was "same type" but this caused "sigs.scala" to fail because a new tree had a constant Int type where the old tree had just Int as the type. It's hard to guard against these narrowings and they look harmless.
* More explanations for -Ycheck failures.Martin Odersky2014-06-131-2/+8
| | | | | In case of "types differ" failure, explain why original and retyped type are not subtypes of each other.
* Adding descriptive message to no-implicits-after-typer assertion.Martin Odersky2014-05-081-1/+1
|
* Adding a check that owner chains are correct for -YcheckMartin Odersky2014-05-081-0/+19
|
* Refining TreeChecker to work immediately after typer.Martin Odersky2014-05-081-21/+36
| | | | | Making TreeChecker work immediately after typer. This requires a number of fixes. Also, errors now cause exceptions instead of being reported on the command line.
* TreeCheckers use re-typing...Martin Odersky2014-04-081-6/+31
| | | | ... to check whether tree types make sense. Still produces errors when enabled.