aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* apply srewrite (explicit types for implicits + no procedure syntaxSamuel Gruetter2014-03-1940-65/+65
| | | | for constructors) to tests/untried/pos
* Merge pull request #79 from DarkDimius/noxmlodersky2014-03-198-45/+196
|\ | | | | Remove dependency on scala-xml.
| * Remove dependency on scala-xml.Dmitry Petrashko2014-03-188-45/+196
| | | | | | | | Mimic https://github.com/scala/scala/commit/4e9b33ab24bb3bf922c37a05a79af364b7b32b84
* | Merge pull request #76 from retronym/topic/defPath-accumodersky2014-03-173-22/+44
|\ \ | |/ |/| Test and refactor TreeInfo#defPath
| * Refactor TreeInfo#defPathJason Zaugg2014-03-161-22/+11
| | | | | | | | Uses a TreeAccumulator, rather than ad-hoc descent through `productIterator`.
| * Test case for TreeInfo#defPathJason Zaugg2014-03-162-0/+33
|/ | | | | | | | | | | I'm about to refactor that method in terms of a TreeAccumulator. Note that I've packaged the test case in `dotty.tools.dotc.ast` I believe this is the best approach for organizing unit tests: the import tax is minimized, and use of relative imports is made less fragile by avoiding creating new packages to test code. I'll reorganize the other unit tests like this if others agree.
* Merge pull request #69 from odersky/topic/generalize-companionsodersky2014-03-168-18/+143
|\ | | | | Bullet-proofing companion objects
| * Fixed parse error with @uncheckedMartin Odersky2014-03-131-1/+1
| | | | | | | | Dotty currently cannot parse @unchecked annotations in pattern types. That's why the previous commit failed. We need to come back to this and fix it. For the moment, to make on the current branch, the annotation is removed.
| * Bullet-proofing companion objectsMartin Odersky2014-03-138-18/+143
| | | | | | | | | | | | | | | | | | | | | | | | Companion class/module computations now also work for local classes and modules. For this to work, either one of two conditions must be met: (1) some enclosing context refers to a scope that contains the companions. (2) the context's compilation unit has a typed tree that contains the companions. (1) is usually true when type-checking, (2) when transforming trees. Local companions are searched as follows: If (2) holds, we locate the statement sequence containing the companions by searching down from the root stored in the compilation unit. Otherwise, we search outwards in the enclosing contexts for a scope containing the companions.
* | Merge pull request #71 from odersky/fixes-for-transformsDmitry Petrashko2014-03-142-4/+17
|\ \ | | | | | | Fixes for transforms
| * | Reset frozen for transformed class denotations.Martin Odersky2014-03-141-2/+13
| | | | | | | | | | | | ... so that we can add new members to transformed class denotations.
| * | Stop running phases after errors were encounteredMartin Odersky2014-03-141-2/+4
| |/
* | Merge pull request #70 from odersky/fix/annotations-in-patternsodersky2014-03-145-10/+15
|\ \ | | | | | | Fixed two problems with annotated types in patterns
| * | Fixed two problems with annotated types in patternsMartin Odersky2014-03-145-10/+15
| |/ | | | | | | | | | | | | | | | | | | Problem 1: The parser did not accept them. It has to accept a "RefinedType" as an ascription, not a "WithType" (as it did before), or even a "SimpleType" (as speced in the SyntaxSummary). Problem 2: Annotations are always typed as expressions. The annotations in question were typed as patterns before. Tests in Patterns.scala and in the Dotty compiler itself.
* | Merge pull request #65 from samuelgruetter/scala-tests-rawodersky2014-03-133539-0/+49725
|\ \ | | | | | | Add untried tests from scala/test/files/{pos,neg}
| * | add tests from scala/test/files/{pos,neg}Samuel Gruetter2014-03-123539-0/+49725
| | | | | | | | | | | | with explicit Unit return type
* | | Merge pull request #64 from DarkDimius/PostTyperTransformerSébastien Doeraene2014-03-1310-46/+421
|\ \ \ | |/ / |/| | Post typer transformer
| * | CreateCompanionObjects transformerDmitry Petrashko2014-03-132-0/+170
| | | | | | | | | | | | | | | A transformer that provides a convenient way to create companion objects.
| * | TreeTransform: add support for transforming statsDmitry Petrashko2014-03-131-37/+54
| | | | | | | | | | | | | | | | | | Added a prepareForStats&transformStats pair of methods, which provide a convinient way to alter scopes of PackageDefs, Templates and Block's.
| * | PostTyper transformersDmitry Petrashko2014-03-133-1/+181
| | | | | | | | | | | | | | | | | | | | | 1) reorders companion objects so that they allways follow matching classes 2) removes imports and named arguments 3) rewrites all trees holding types are to TypeTrees
| * | Fix for #55Martin Odersky2014-03-122-2/+6
| | | | | | | | | | | | | | | Distringuish between ModifierFlags -- which can appear in trees -- and SourceModifierFlags -- which are modifiers according to the language spec.
| * | Fix of #56 - newModuleSymbol & newCompleteModuleSymbolMartin Odersky2014-03-122-6/+10
| |/ | | | | | | | | Needs new TypeRef creation method that works for NoPrefix and at the same time does not need a denotation. This is provided by method TermRef.withNakedSymbol.
* | Merge pull request #63 from odersky/implicit-testodersky2014-03-121-2/+10
|\ \ | |/ |/| Added test for implicits which fail in Scala 2.11.
| * Added test for implicits which fail in Scala 2.11.Martin Odersky2014-03-121-2/+10
|/ | | | Mentioned in scala-user by Haoyi Li on 12-Mar-2014
* Merge pull request #61 from odersky/fixes-t00xxodersky2014-03-128-10/+45
|\ | | | | Fixes t00xx
| * Fix constructor completion problem detected in t0054Martin Odersky2014-03-124-7/+20
| | | | | | | | | | | | | | | | | | Constructors need to be completed in the context which immediately encloses a class. Otherwise type references in the constructor see the wrong types, as is demonstrated in t0054. The difficulty here is that the inner class B nested in A also extends from A. Then it makes a difference whether the constructor parameter types of B are resolved in the context of B or in the context of A. Added explanation for context handling of constructors.
| * Fix problems related to t0039Martin Odersky2014-03-106-8/+24
| | | | | | | | | | | | | | | | | | | | | | This test case exercised several problems: 1.)2.) Two ways to run into a cyclic references. Fixed by - assuming an early info when completing a typedef, similarly to what is done for a classdef - doing wellformed bounds checking in a later phase. Failure to check whether arguments correspond to F-bounds. - a substitution was missing.
| * Fix for t1002Martin Odersky2014-03-102-1/+7
| | | | | | | | | | Need to compile the self type of a class not in the context of the class members but one context further out. Reason: self type should not be able to see the members.
* | Merge pull request #60 from odersky/fix/#50-volatileodersky2014-03-1210-70/+113
|\ \ | |/ |/| Fix/#50 volatile
| * Added lost comment to isVolatile.Martin Odersky2014-03-121-0/+16
| |
| * Fix of #50 - volatileMartin Odersky2014-03-0910-70/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Volatile checking needs to take all intersections into account; previously these could be discarded through needsChecking. Plus several refactorings and additions. 1) Module vals now have Final and Stable flags set 2) All logic around isVolatile is now in TypeOps; some of it was moved from Types. 3) Added stability checking to Select and SelectFromType typings. Todo: We should find a better name for isVolatile. Maybe define the negation instead under the name "isRealizable"?.
* | Merge pull request #54 from odersky/Improve/better-testsodersky2014-03-104-308/+64
|\ \ | | | | | | Improve test infrastructure
| * | Improve test infrastructureMartin Odersky2014-03-104-308/+64
| |/ | | | | | | | | | | | | | | | | 1) New method compileFiles which allows one to compile the content of a directory one file or directory after another. 2) max constraint is printed to typr. Added new test pos_all. Other pos tests can be retired.
* | Merge pull request #49 from DarkDimius/scriptDmitry Petrashko2014-03-081-0/+232
|\ \ | |/ |/| Bringing back dotc script that was accidentely deleted.
| * Bringing back dotc script that was accidentely deleted.Dmitry Petrashko2014-03-071-0/+232
| |
* | Merge pull request #47 from odersky/try/typer-reorgodersky2014-03-0819-909/+1087
|\ \ | |/ |/| Try/typer reorg
| * Main Typer reorg.Martin Odersky2014-03-078-394/+472
| | | | | | | | Common code between tpd and Typer has been factored out into class TypeAssigner.
| * Scond step to typer reorg: Introduce TypeAssigners.Martin Odersky2014-03-077-41/+72
| | | | | | | | | | TypeAssigners assign a toplevel type to a node. They are mixed into Typer, and can be accessed from tpd using ctx.typeAssigner.
| * First step towards Typer Reorganization.Martin Odersky2014-03-0710-503/+537
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Goal is better modularization and avoiding code duplication and divergence between Typer and tpd. As a first step, we split Inferencing into Inferencing, Checking, and ProtoTypes. Inferencing and Checking become Typer traits, while ProtoTypes remains a global object. Eventually: - we want to have a SimpleTyper, which does the main stuff in tpd, and can mixin either full checking or no checking. Each method in SimpleTyper takes an untyped tree (which is assumed to have typed arguments) and adds a toplevel type to that tree. The methods subsume the type-checking parts in Typers, except for (1) simplifications and expansions (2) computing prototypes and recursing with them into childtrees (3) adaptation. The method calls the necessary checking operations, which may however be stubbed out. The idea is already exercised in the typechecking code for Literal and New, except that for now it calls methods in tpd (they will become methods in SimpleTyper instead). - Typer should inherit from SimpleTyper, and forward all logic except for (1) - (3) to it. - tpd should call the simple typer it gets from ctx.typer - ctx.typer should be a SimpleTyper, not a complete one.
| * Removed useless ValDef flagged by @samuelgruetter in previous pull requestMartin Odersky2014-03-072-2/+19
| |
| * Fix of accidental omission in TypeComparerMartin Odersky2014-03-071-1/+3
| |
| * Added test for overloaded access with import/inheritance conflictMartin Odersky2014-03-071-0/+1
| |
| * Fix problem comparing overloaded TermRefsMartin Odersky2014-03-072-4/+20
| | | | | | | | Overloaded TermRefs do not have an info, and consequently do not support =:=. Yet in Typer#checkNewOrShadowed we compared termrefs with =:=. This gives an exception if the termrefs are overloaded. The fix is to provide a new method isSameRef in TypeComparer which is called instead of =:= in Typer#checkNewOrShadowed.
| * Fix problem in TermRef.alternativesMartin Odersky2014-03-071-1/+1
| | | | | | | | Rewrap needs to produce alternatives with signatures. Otgerwise the new denotation will simply overwrite the old because both the overloaded TermRef and the alternative will hash to the same unique TermRef.
| * Made TypeBoundsTrees to be TypTrees so they are eliminated by PostTyperTransformMartin Odersky2014-03-072-2/+1
|/
* Merge pull request #45 from DarkDimius/noSharedTreesSébastien Doeraene2014-03-077-44/+4
|\ | | | | Get rid of SharedTree
| * Got rid of SharedTreeDmitry Petrashko2014-03-067-44/+4
| |
* | Merge pull request #43 from DarkDimius/tree-transformerDmitry Petrashko2014-03-062-0/+1255
|\ \ | | | | | | Tree transformer&TreeTransform
| * | Tree Transformer&TreeTransform:Dmitry Petrashko2014-03-062-0/+1255
| |/ | | | | | | | | | | | | | | 1) using fast tracks in case node type isn't altered by Transformation; 2) using pre-computed hints(nxTransformXXX arrays) to quickly jump to next transformation interested in transforming particular Tree type; 3) using pre-computed hints(nxPrepareXXX arrays) to know which transformations are going to 'prepare' for transforming particular Tree type; 4) recomputing those hints in case some transformation changed implementation class during 'prepare'; 5) TreeTransform is now responsible of calling transformFollowing on nodes created by it.
* | Merge pull request #42 from odersky/fix/#39-checkAccessibleodersky2014-03-065-34/+75
|\ \ | |/ |/| Fix of #39