aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/Symbols.scala
Commit message (Collapse)AuthorAgeFilesLines
* Refactored TreeTypeMapMartin Odersky2014-08-181-20/+12
| | | | Goes into a separate source files. Several simplifying refactorings.
* Fixes to TreeTypeMapMartin Odersky2014-08-181-8/+21
| | | | | | | | | (1) Template nodes have to be treated specially. They contain primary constructors, self definitions and local dummys, all of which have to be properly mapped and re-integrated. (2) Symbol substitutions have ot be done all together instead of one after the other. (3) When creating new symbols, need to create ClassSymbols for ClassSymbols.
* Package denotations are never transformedMartin Odersky2014-08-131-1/+5
| | | | | | | | | | | | Packages should always have a single denotation, which is invariant for all transformations. Package members should always be entered in the first phase, and should never be entered after a given phase. This reflects the fact that package members correspond to classfiles. Once you create a classfile, it stays around and is available from the start of the next run. Also, we need to prevent multiple denotation versions of packages from hanging on to stale symbols. It would not be enough to replace a package member by a newly compiled one; if packages had multiple denotations we'd have to do this for all of them.
* Fixed problem with missing denotations in polyDefDefMartin Odersky2014-07-171-0/+4
| | | | Problem was reported by @darkdimius. Test case will come in next commit.
* Make TypeParamCreation flags depend on ownerMartin Odersky2014-07-171-1/+1
| | | | | | Type params should have different flags, depending on whether they are owned by a method or a class. Only class type parameters are marked Deferred, protected, and Local.
* Move valueclass functionality into its own ValueClass module.Martin Odersky2014-07-171-8/+2
|
* Various cleanups and utility additionsMartin Odersky2014-07-171-4/+2
| | | | | | | - Some new functionality in tpd and in Symbols. - Added `sm` interpolator to print nicely. - Make use of nestedMap where possible. - Add IdentityDenotTransformer as a convencience class
* Added phase: SuperAccessorsMartin Odersky2014-07-171-0/+12
| | | | | Rewrote SuperAccessors (more to be done; see comments), and added stuff here and there to make it work smoother.
* Allow closures to take type parameters.Dmitry Petrashko2014-04-111-2/+2
| | | | | | | | This shouldn't require any changes to backend, as all type parameters will be erased in erasure Conflicts: src/dotty/tools/dotc/core/Symbols.scala
* Reworked TermRef handlingMartin Odersky2014-04-081-2/+2
| | | | | | | | | | | | | | | The main problem with TermRef handling was that signatures were not always tracked correctly. New invariant: A TermRef that points to a symbol is always a TermRefWithSig, and the signature is the one of the corresponding member. We achieve this by sometimes generating a new TermRefWithSig if a TermRef gets a denotation. One possible simplification would be to always store a signature in a TermRef. There's still a problem in TermRefWithSig#newLikeThis, which currently works only if the previously stored denotation references a symbol. We will need to generalize JointRefDenotation to contain multiple symbols for a complete fix.
* Reworked erasure denotation transformerMartin Odersky2014-03-291-0/+5
| | | | | | | | | | | | | | | | Now works for all combinations of java/scala sue ErasedValueClass/go directly to underlying type constructors/others wildcards ok/not Signatures had to be refined as well, because the signature depends on whether a type comes form Java or Scala (handling of intersections is different). Also, replaced splitArray method in TypeApplication by extractors for single- and multi-dimensional array types in definitions.
* Renaming core.Transformer(s) -> core.DenotTransformer(s)Martin Odersky2014-03-181-1/+0
| | | | To bring in line with TreeTransformer terminology.
* Renamings TreeTransformer -> TreeMap, TreeMapper -> TreeTypeMapMartin Odersky2014-03-181-2/+2
| | | | | | | This makes naming uniform between trees and types, and also avoids the clash with transform.TreeTransformer. The idea is that transformers are parts of phases, and have logic that is phase-specific. In particular, a context is passed around when transforming a tree. Maps are simpler, they only have a T -> T apply method.
* Fix of #56 - newModuleSymbol & newCompleteModuleSymbolMartin Odersky2014-03-121-2/+2
| | | | | 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.
* Got rid of SharedTreeDmitry Petrashko2014-03-061-2/+2
|
* More informative asserts.Dmitry Petrashko2014-03-031-3/+3
|
* Reord of superIdsMartin Odersky2014-02-251-8/+4
| | | | | | | 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.
* Avoid memory leaks on repeated compilation.Martin Odersky2014-02-241-1/+1
| | | | | | | | | | | | | | | | | 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.
* Some small doc changesMartin Odersky2014-02-161-1/+9
|
* New scheme for attachments.Martin Odersky2014-02-111-3/+10
| | | | | | | Added general way to put attachments on some base type (which needs to inherit from Attachment.Container). Used it to turn typedTree map into an attachment. Also, moved DotClass to dotc.util.
* Symbol loaders no longer complete with creation contextMartin Odersky2014-02-091-1/+1
| | | | | | Instead current ctx is passed through everywhere. Question: can we factor out ctx better?
* Getting rid of some CompleInCreationContextsMartin Odersky2014-02-091-2/+2
|
* Skolems are permanent, but not packages.Martin Odersky2014-02-091-3/+5
|
* Make skolems live forever...Martin Odersky2014-02-061-1/+1
| | | | ... because there's no way to reload them in a new run.
* New treatment of uniquesMartin Odersky2014-01-261-3/+3
| | | | | | | | To avoid to always create a type before checking its uniqueness we specialize on the three most common categories: RefinedTypes, TypeBounds and NamedTypes. Each category gets its own uniques map. Hashing is disentangled from Types. The new treatement seems to give some improvement (2-5%?) but not much.
* Avoid stale symbol errors for package objectsMartin Odersky2014-01-151-1/+1
| | | | Happened (albeit non-deterministally) when compiling parsing/*.scala
* Output cleanupsMartin Odersky2014-01-041-1/+1
|
* Making showDcls return a string.Martin Odersky2013-12-221-1/+1
| | | | ... as all other show methods do.
* Cleanup of TermRef.withSym and TypeRef.withSymMartin Odersky2013-11-251-3/+3
| | | | All occurrences replaced by select, or second version of Term/TypeRef.apply
* Renaming: typeConstructor -> typeRefMartin Odersky2013-11-221-2/+2
|
* Fixed logic in newTypeParamsMartin Odersky2013-09-301-4/+11
| | | | gave a NPE before.
* Module classes are now enteredMartin Odersky2013-09-241-0/+1
| | | | Module classes are entered alongisde their source modules in parent scope.
* Changed Throwing reporting scheme.Martin Odersky2013-09-231-1/+1
| | | | | Changed ThrowingReporter to use an underlying reporter for issuing messages below ERROR. Made ThrowingReporters the default in initialContext.
* More typer bug fixes and improvements in error messagesMartin Odersky2013-08-221-2/+1
|
* Various bug fixes for typer.Martin Odersky2013-08-221-2/+6
|
* Some additions to module completionMartin Odersky2013-08-191-5/+4
| | | | … more to come. Plus some bugfixes.
* Several fixes and refactorings for typecheckingMartin Odersky2013-08-191-4/+4
| | | | | | | | | | | 1) Refactoring of package loaders that ensures that a package is always loaded before new members are entered. This led to a refactoring of sourceModule in completers into its own trait 2) Refactoring of optSelfType ot selfInfo. Class Infos may now have a reference to a symbol in their selfInfo field, instead of always a type, as it was before. This allows to introduce laziness for self type evaluation. Laziness is needed so that modules can be desugared and the desugared version be compiled without special tricks. 3) <init> and $init members are no longer inherited. 4) Refactoring of createSymbol and enterSym, so that creating symbols and entering them in a scope is decoupled. Renamed the driver operation form `enterSym(s)` to `index`.
* Various bugfixes for namer/typer/treesMartin Odersky2013-08-161-0/+4
|
* ErrorSymbols now have TypeBounds as info when they are type symbols.Martin Odersky2013-08-141-0/+4
|
* Implementation of match/case def including GADT pattern matching.Martin Odersky2013-08-081-0/+27
|
* Adding diagnostics how many stubs were generatedMartin Odersky2013-07-121-1/+3
|
* Avoided cycle in newCompletePackageSymbol by passing name explicity.Martin Odersky2013-07-111-9/+9
|
* Added functionality to deal with function applications.Martin Odersky2013-07-111-1/+1
| | | | | | | | | | | | | - Added Applications class to represent applications - Added Constraint class to represent type constraints - Added TyperState class to represent typer state - Added Diagnostic class to buffer errors and warnings - Added Inferencing class that contains some common functionality for type inferencing (this one's still rudimentary). - Added extractor for FunctionType in Definitions - Added desugaring of default parameters to default getters in Desugar - Added flags to deal with default parameters - Added substitutions that replace bound parameters
* Made pos a total method on Symbols, returns NoSymbol if undefined.Martin Odersky2013-06-121-3/+3
|
* Added `pos` meethod to symbols.Martin Odersky2013-06-071-0/+5
|
* Namer redesign.Martin Odersky2013-06-061-2/+2
| | | | A new design that relies on DefDef local maps, instead of global maps before.
* wip, because I have to get off this machine.Martin Odersky2013-05-301-1/+1
|
* Made tpd/untpd toplevel objects.Martin Odersky2013-05-221-2/+1
| | | | Moved all other elements of TypedTrees and UntypedTrees into tpd and untpd.
* More tree refactorings.Martin Odersky2013-05-221-3/+5
| | | | | | | 1) Getting rid of ugen in favor of untpd. 2) Eliminating some unused methods 3) Splitting out CheckTrees from TypedTrees. 4) Moving trees and related classes into separate package dotc.ast
* Refactored Printing architecture.Martin Odersky2013-05-171-1/+2
| | | | | Split printers into several files. Added refined printing of trees. Changed Showable and generalized printing under a precedence.