aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* | 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
| * Fix of #39Martin Odersky2014-03-045-34/+75
| | | | | | | | | | | | | | | | Two fixes: 1) Avoid the infinite recursion in checkAccessible if the accessibility check fails. 2) Make accessibility succeed for the test, and in general if the target denotation does not have a symbol. Added original test in pos and a negative test which makes accessibility fail.
* | Merge pull request #41 from DarkDimius/virtualFileodersky2014-03-041-6/+10
|\ \ | |/ |/| Use virtual file instead of temporary file for tests
| * Use virtual file instead of temporary file for testsDmitry Petrashko2014-03-041-6/+10
|/
* Merge pull request #37 from DarkDimius/assertionsDmitry Petrashko2014-03-0423-34/+30
|\ | | | | Typos, better assertions, dead code
| * Typos corrected.Dmitry Petrashko2014-03-0314-17/+17
| | | | | | | | | | More verbose assertions. Unnecessary semicolons removed.
| * More informative asserts.Dmitry Petrashko2014-03-0310-17/+13
| |
* | Merge pull request #35 from DarkDimius/tests-2Dmitry Petrashko2014-03-032-19/+29
|\ \ | | | | | | For some tests context is required, it should be passed to checker phase.
| * | For some tests context is required, it should be passed to checker phase.Dmitry Petrashko2014-03-032-19/+29
| |/
* | Merge pull request #38 from odersky/fix/#34-pathresolversDmitry Petrashko2014-03-0312-33/+94
|\ \ | | | | | | Fix/#34 pathresolvers
| * | Fix of #34Martin Odersky2014-03-0311-33/+88
| | | | | | | | | | | | | | | | | | | | | | | | The root cause of #34 was that we took a type argument which was an existential type. These are returned as type bounds, which make no sense in the calling context. To avoid that problem in the future, `typeArgs` got renamed to `argInfos`, so it is clear we get an info, not necessarily a value type. There are also added method `argTypes`, `argTypesLo`, `argTypesHi`, which return a type, but either throw an exception or return a lower/upper approximation of the argument is an existential type. There's another issue that the existential type only arose when compiling the same couple fo files the seciond time. We need to chase that one down separately.
| * | Add test case for #34Martin Odersky2014-03-031-0/+6
| | | | | | | | | | | | Right now this one fails.
* | | Merge pull request #32 from DarkDimius/verbose_exDmitry Petrashko2014-03-031-0/+2
|\ \ \ | |_|/ |/| | Enable verbose printing of exceptions thrown in junit tests
| * | Enable verbose printing of exceptions thrown in junit testsDmitry Petrashko2014-03-021-0/+2
|/ /
* | Merge pull request #31 from DarkDimius/testsDarkDimius2014-03-024-1/+52
|\ \ | |/ |/| | | Infrastructure for per-phase tests, with inline source as a string.
| * Infrastructure for per-phase tests, with inline source as a string.Dmitry Petrashko2014-03-014-1/+52
| |
* | Rename baseType -> baseTypeRefMartin Odersky2014-03-029-31/+54
| | | | | | | | | | | | | | What was `baseType` and is now `baseTypeRef` only computes the prefix of of basetype, not the type arguments. If type arguments need to be included there is `baseTypeWithArgs`. The reason is that type arguments are usually already encoded as member types. But this was a source of errors because in Scala 2, baseType includes the type arguements. (also added test file structural.scala forgotten from last commit)
* | Fix problem when handling structural types without a nominal parent type.Martin Odersky2014-03-013-2/+5
| | | | | | | | We need to use Object as parent then, but this was forgotten.
* | Check that inferred parent classes are feasible.Martin Odersky2014-03-014-9/+39
| |
* | Fixing glb/lub of TypeBoundsMartin Odersky2014-03-012-25/+22
| | | | | | | | Need to take variances into account when forming & or | of bounds. Achieved by moving code from distributeAnd/Or to TypeBounds &/|.
* | Reorganization of template parents.Martin Odersky2014-03-0111-78/+142
| | | | | | | | | | | | | | | | | | | | | | Template parents always were constructor calls before. This is not correct because in a situation like the one elaborated in templateParents, the trait D has the class C as supertype, but it does not call its constructor (in fact, if we added a () parameter list to make it into a constructor this would be wrong because C takes parameters. Now parents can be either types or constructor calls. The logic in Namer and Typer that deals with parents is cleaned up. In particular, we now construct any synthetic class parent as a full type, before calling normalizeToClassRefs. This obviates the forwardRefs logic that needed to be done in a cleanup of Namers. Also added two more checks: (1) All parents except the first one must point to traits. (2) A trait may not call a parent class constructor.
* | More precise untyped tree handlingMartin Odersky2014-03-011-10/+35
| | | | | | | | | | 1) Untyped trees now have precise isType/isTerm methods. 2) The New(tree, args) method can now also handle TypedSplices.
* | Drop task of simplifying hk types.Martin Odersky2014-02-281-3/+1
|/ | | | See examplation in 2nd commit of branch aborted/simplify-hk.
* Cleanup of isSubTypeMartin Odersky2014-02-261-24/+19
|
* Performance improvement: Avoid unncecessary allocations of ListBufferMartin Odersky2014-02-263-235/+4
| | | | There were a lot in StoreReporter, as we are creating about 0.5M new ones per self-compile.
* Performance tweak: Denotation.symbol is a parameter.Martin Odersky2014-02-262-16/+13
| | | | This avoids the megamorphic dispatch on symbol before. Looked promising in the profiler (symbol showed up at 9%) but does not seem to gain much in practice. Still, can't hurt to do it.
* Performance improvements: Split long TypeMap#mapOver and move hot fields ↵Martin Odersky2014-02-263-74/+92
| | | | into locals.
* Reord of superIdsMartin Odersky2014-02-255-26/+23
| | | | | | | 1) We now keep an association between ClassSymbol and SuperId (instead of TypeRef and SuperId). That's better because superId's are deleted anyway after each run, so we gain nothing by keeping a stable ref. 2) hasChildren got dropped. It was too unreliable. The mere fact that someone take's the superId of a class does not means that that class has children.
* Performance improvement: Avoid most operations in interpolateUndetVarsMartin Odersky2014-02-254-73/+39
| | | | | | Perform the operation only if there are qualifying type variables, which is rarely the case. Reverted variances optimization to simpler and shorter previous implementation, because variances is no longer hot.
* Misc performance improvements by eliminating stupid allocationsMartin Odersky2014-02-245-21/+25
| | | | | | - Avoid closure creation in Position. - Avoid creating debug string in SymDenotations - Avoid creating Flag translation tables in pickle buffers
* Avoid memory leaks on repeated compilation.Martin Odersky2014-02-2410-36/+54
| | | | | | | | | | | | | | | | | Several measures: 1. Invalidate classOfId and superIdOfClass in ContextBase after each run. These contain local classes that should become inaccessible. 2. Also clear implicitScope cache that maps types to their implicit scopes after each run. (not sure whether this is needed; it did show up in paths from root, but on second thought this might have been a gc-able cycle. 3. Avoid capturing contexts in lazy annotations. 4. Avoid capturing contexts in functions that compute souceModule and moduleClass 5. Avoid capturing contexts in Unpickler's postReadOp hook.
* Resetting uniques and hashset reorg.Martin Odersky2014-02-245-59/+83
| | | | Uniques are now cleared after each run. Also, HashSets get a more standard API, without a label, but with configurable load factor.