aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/Contexts.scala
Commit message (Collapse)AuthorAgeFilesLines
...
* Allow disabling squarshingDmitry Petrashko2015-02-191-3/+6
| | | | Do not die if phases aren't squashed
* Harden implicit scope computation against CyclicReference errors.Martin Odersky2014-12-191-1/+5
|
* Merge pull request #271 from dotty-staging/fix/i268-gadtsodersky2014-12-191-0/+15
|\ | | | | Fixed #264 - failure to typecheck GADTs
| * Made gadt map better encapsulated.Martin Odersky2014-12-161-1/+6
| |
| * Fixed #264 - failure to typecheck GADTsMartin Odersky2014-12-161-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | The previous scheme derived the right bounds, but then failed to use them because a TypeRef already has a set info (its bounds). Changing the bounds in the symbol by a side effect does not affect that. This is good! But it showed that the previous scheme was too fragile because it used a sneaky side effect when updating the symbol info which failed to propgate into the cached info in TypeRef. We now keep GADT computed bounds separate form the symbol info in a map `gadt` in the current context.
* | Merge pull request #270 from dotty-staging/change/type-aliasesodersky2014-12-171-2/+2
|\ \ | |/ |/| Change/type aliases
| * Create TypeAlias subclass of TypeBouundsMartin Odersky2014-12-101-2/+2
| | | | | | | | Specialize hash consing of type aliases.
* | Make sure the period of a context always contains a single phaseMartin Odersky2014-12-141-3/+5
|/ | | | | Multi-phase periods mean that ctx.phaseId is no longer valid, which means a lot of invariants break.
* Previous scheme was buggy; leaked Array types to backend.Martin Odersky2014-11-281-1/+1
| | | | | | Now: All new Array[T] methods are translated to calls of the form dotty.Arrays.newXYZArray ...
* Take supercalls into account for statement contextMartin Odersky2014-11-091-4/+9
| | | | | After Mixin, super calls can appear in statemenr sequences. They need to be typechecked and transformed using a special context.
* Print whole TreeTransform name in Ycheck and XprintDmitry Petrashko2014-10-301-0/+4
|
* Fix to primaryConstructorMartin Odersky2014-10-111-1/+1
| | | | | Primary constructor was picking last constructor instead of first one. This is now fixed. Also, added paramAccessors utility method.
* Add inSuperCall mode and flag.Martin Odersky2014-09-041-1/+2
| | | | | Needed to keep a record of definitions in supercall arguments. These may not see the enclosing class.
* Special context for self constructor argsMartin Odersky2014-08-241-8/+5
| | | | | Arguments to this(...) calls need a special contet, similar to - but different from - the supercall context.
* Fix context for super callsMartin Odersky2014-08-241-0/+50
| | | | | | | | Super calls need to have special contexts, going beyond super-mode. It's explained in detail in Context#superCallContext. this(...) calls also need special contexts, but this is not enabled yet (some tests fail, need to track down why).
* Better printing of denotations.Martin Odersky2014-04-081-2/+1
| | | | | Used to print <none> for denotations with a symbol, now prints "some I" where I is the denotation's info.Reworked phases.
* Merge pull request #99 from samuelgruetter/infostring2odersky2014-04-041-3/+0
|\ | | | | Error reporting improvements
| * remove var ContextBase.suppressNonSensicalErrors, andSamuel Gruetter2014-04-021-3/+0
| | | | | | | | decouple Diagnostic from ContextBase
* | Merge pull request #105 from DarkDimius/docsDmitry Petrashko2014-04-021-0/+5
|\ \ | | | | | | Documentation and a bit of cleanup.
| * | Documentation and a bit of cleanup.Dmitry Petrashko2014-04-011-0/+5
| |/ | | | | | | | | | | Added documentation for non-trivial logic in Contexts, Phases and TreeTransforms. Removed redundant vars and casts
* / Intercepted methods transformerDmitry Petrashko2014-04-021-1/+3
|/ | | | | | | Replace member references for: methods inside Any( == and !=) ## on primitives .getClass on primitives
* Memoizing Context#withPhaseDmitry Petrashko2014-03-311-18/+33
| | | | | | | withPhase operations in contexts are now memoized. Conflicts: src/dotty/tools/dotc/core/Contexts.scala
* Renaming clear->setNewMartin Odersky2014-03-311-2/+2
| | | | | | clear is wrong. E.g. clearTyperState does not clear the typerstate at all. It installs a fresh (i.e. cloned) copy of the previous one. clearScope is also wrong; it installs a new scope, does not clear the current one.
* Maintaining owners during transformationsMartin Odersky2014-03-311-0/+3
| | | | | | | | | | | | | | | | | The transformation framework needed to be changed so that contexts passed to transformations have correct owner chains. These owner chins are demanded by the Splitter phase. Note: I eliminated the contexts array in TransformInfo because it interfered with the owner computations. Generally, caching contexts with some phase is best done in Contexts, because withPhase is also used heavily in othre code, not just in Transformers. New phase: Splitter When it is complete, it will make sure that every term Ident and Select node carries a symbol. Right now, all it does is coverting self reference idents to "this"-nodes.
* Fix #95: Phases now have their own periods.Dmitry Petrashko2014-03-271-4/+8
|
* Rename methods on FreshContext to make mutation obviousDmitry Petrashko2014-03-271-32/+32
| | | | And avoid name clashes
* Fix context.withPhaseMartin Odersky2014-03-271-5/+5
| | | | | | Previous version was wrong because every context is a fresh context at runtime, so the overriding version would always be executed, which means that withPhase becomes a side-effecting operation!
* Merge pull request #89 from dotty-staging/fix/transform-contextsDmitry Petrashko2014-03-241-2/+7
|\ | | | | | | Fix phase of context for denotation transformer
| * Fix phase of context for denotation transformerMartin Odersky2014-03-241-2/+6
|/ | | | The phase is now always the phase on which the denotation transformer is defined.
* Removed explicit tuplings from dotc codebase.Martin Odersky2014-03-201-1/+1
| | | | Eliminated all "Dotty deviations" which were due to lack of auto-tupling.
* Allow MiniPhase to be DenotTransformerDmitry Petrashko2014-03-191-3/+8
| | | | | | All MiniPhases now as are full-fledged phases, and are given their own periods and can register DenotTransformers. MiniPhases belonging to same group(list) will be squashed to single phase.
* Refactored denotation transformersMartin Odersky2014-03-181-1/+4
| | | | | | | | Many small and large changes. Added samplePhase to demonstrate functionality. To test functioning, run the compiler with args tests/pos/uncurry.scala -Ylog:sample,terminal
* Renaming core.Transformer(s) -> core.DenotTransformer(s)Martin Odersky2014-03-181-1/+1
| | | | To bring in line with TreeTransformer terminology.
* Scond step to typer reorg: Introduce TypeAssigners.Martin Odersky2014-03-071-5/+8
| | | | | TypeAssigners assign a toplevel type to a node. They are mixed into Typer, and can be accessed from tpd using ctx.typeAssigner.
* Typos corrected.Dmitry Petrashko2014-03-031-1/+1
| | | | | More verbose assertions. Unnecessary semicolons removed.
* Reord of superIdsMartin Odersky2014-02-251-3/+3
| | | | | | | 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-0/+3
| | | | | | | | | | | | | | | | | 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-241-4/+11
| | | | Uniques are now cleared after each run. Also, HashSets get a more standard API, without a label, but with configurable load factor.
* Drop unique hashing for superId bitsetsMartin Odersky2014-02-211-7/+0
| | | | Reason: (1) There are few sets: When compiling doty itself, 1.2K sets total, hashed to 500 uniques. (2) Bitset comparison is expensive because it relies on a double inclusion test. (This should be fixed in the Scala stdlib).
* Make Definitions load all symbols in current runId.Martin Odersky2014-02-101-1/+1
|
* Symbol loaders no longer complete with creation contextMartin Odersky2014-02-091-3/+3
| | | | | | Instead current ctx is passed through everywhere. Question: can we factor out ctx better?
* Move maxConstraint computation to RunInfo to avoid references to stale symbols.Martin Odersky2014-02-091-1/+1
|
* Relaxing check that implicits must have explicit return typeMartin Odersky2014-02-021-2/+2
| | | | | | Now this is required only for members of a template. Local statements can still have implicits with no result type. (Maybe we need to get back on this). Also, changed Dotty itself and tests to adhere to the new restriction.
* Avoid accessing implicits that come from root imports that are hidden by ↵Martin Odersky2014-02-021-4/+7
| | | | | | | | | | | | some nested import. This also changes the criterion when a root import is disabled. A root import is now disabled if there is an inner import from the same package or module, and the inner import contains at least one disabling clause X => _. (The latter crierion is new; without it, we would consider something like import scala.{collections => c} as a hiding import for Scala, which seems to go too far.)
* wip for implicits handling root imports.Martin Odersky2014-02-021-3/+5
|
* Replacing most occurrences of HashMap with AnyRefMapMartin Odersky2014-01-301-1/+1
|
* Selective caching of SelectionProtos and ViewProtosMartin Odersky2014-01-271-1/+1
| | | | | | We cache SelectionProtos if their "compat" parameter is "NoViewsAllowed". We always cache ViewProtos. That's important for implicit search, because this enables eligible refs to be better cached. To make this work, we add a case to WildApprox which massages SelectionProtos so they also get noViewsAllowed in the compat parameter.
* New treatment of uniquesMartin Odersky2014-01-261-2/+16
| | | | | | | | 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.
* Some more statistic samplingMartin Odersky2014-01-261-0/+2
|
* Augment namedParts to follow through on some proxy types.Martin Odersky2014-01-091-5/+3
| | | | Now handled: ConstantTypes, MethodParam, PolyParam