aboutsummaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
* Final set of Types tweaksMartin Odersky2013-11-253-17/+14
| | | | - make namedParts return an ordered collection.
* More Types polishingsMartin Odersky2013-11-252-121/+137
| | | | In paricular, now type accumulators include the prefix of a ClassInfo type.
* Cleanup of TermRef.withSym and TypeRef.withSymMartin Odersky2013-11-2511-31/+27
| | | | All occurrences replaced by select, or second version of Term/TypeRef.apply
* Getting rid of UnknownSignatureMartin Odersky2013-11-252-29/+21
| | | | I believe the logic is now clearer. Good to have one magic value less.
* More Types polishingMartin Odersky2013-11-252-58/+31
|
* Types refactoringsMartin Odersky2013-11-257-388/+414
| | | | | | - moving out type applicaton related operations to a decorator: TypeApplications - converting some set operations to list operations to make them replayable. - moving unused operations to Types.overflow
* Cleanup of named type creation from SymDenotations.Martin Odersky2013-11-2313-57/+58
| | | | | | | | | New operations: - typeRef - termRef - valRef (like termRef, but with NotAMethod signature) - termRefWithSig (like termRef, but with denotation's signature)
* Renaming: typeConstructor -> typeRefMartin Odersky2013-11-2218-96/+96
|
* More tweaks to TypesMartin Odersky2013-11-221-74/+74
|
* Tweaks to SimpleMapMartin Odersky2013-11-221-62/+94
| | | | Now uses a custom representation for sizes 4 and over. This improves on the previous representation in terms of immutable.Map because it is more efficient for smaller sizes and keeps orderedness. Being ordered is important for making things replayable.
* Dropping cinsistency checking logic from typerstates.Martin Odersky2013-11-224-79/+32
| | | | Because of the new typerstate design, we can enforce most invariants by design, or in a purely local manner. We can therefore drop the checkConsistent checks and replace them with much more lightweight assertions that make sure that only committable states are committed and only committable states can create typevars.
* Consolidation of TyperState and ConstraintMartin Odersky2013-11-216-106/+148
| | | | Removing undetVars and instTypes as separately assignable fields. This is better for maintaining invariants by design.
* Better encapsulation for constraints.Martin Odersky2013-11-203-40/+44
| | | | The fact that constraints are maps from PolyTypes to Array[Type] is now hidden form the restr of the program (Or, almost; unfortunately value classes force us to expose the parameter, but we renamed it to a name which is typically used for private data).
* Splitting constraint.appky into at, bounds, contains.Martin Odersky2013-11-204-11/+16
| | | | Motivation: Keep usages separate, prepare for larger constraint refactoring.
* More tweaksMartin Odersky2013-11-204-6/+13
|
* Added unit testing supportMartin Odersky2013-11-183-13/+25
|
* Various cleanupsMartin Odersky2013-11-186-55/+44
|
* Changing some TermRef's to selectsMartin Odersky2013-11-161-4/+4
|
* Converting most uses of NamedType to select.Martin Odersky2013-11-158-39/+48
| | | | | Select reduces refinetype/typeref pairs and is therefore preferable over raw NamedType. Still need to do the same for TypeRefs.
* Formign lubs over widened types only.Martin Odersky2013-11-151-1/+6
| | | | To avoid noisy lubs such as Int(1) | Int(2) | Int(3), we impose the rule that A | B is valid only if A and B are non-singleton, widened types. This also maps Nil | Cons automatically to List, and maps None | Option automatically to Some.
* Tweaks to adaptation and interpolationMartin Odersky2013-11-156-17/+25
| | | | | | | 1. Needed to interpolate aftyer implicit parameyters are added. 2. Also needed to avoid constraining typevars if compared against selection proto. Original coder example now typechecks.
* Tweak to Coder testMartin Odersky2013-11-151-1/+1
|
* Made stripTypeVar idempotentMartin Odersky2013-11-151-4/+9
| | | | The unstated assumption everywhere was that stripTypeVar would get rid of TypeVars. But it didn't if we had a TypeVar isntantiated to a TypeVar. Now it follows through chains of TypeVars.
* making all internal errors throw exceptions (for now).Martin Odersky2013-11-142-2/+2
| | | | Better for now, since we do not want them do be hidden when testing / debugging the compiler.
* derivedNamedType -> derivedSelectMartin Odersky2013-11-143-12/+17
| | | | Performing refined/typeref reduction everywhere
* Providing for new match scheme.Martin Odersky2013-11-141-8/+9
| | | | See doc comment for Config.newMatch what this is about,
* Making as seenfrom reduce types.Martin Odersky2013-11-142-32/+22
| | | | Adding operattions select, derivedSelect which reduce combinations of typerefs over refinement types.
* Some configuation parametersMartin Odersky2013-11-147-31/+47
| | | | Caching, plus whether we want to match on signatures or types.
* replace qualifierType by widenIfUnstable.Martin Odersky2013-11-143-4/+7
| | | | Also, throw an exception on internal errors rather than issuing an error (this helps debugging, should be reverted for production).
* Changes to dealiasing and wideningMartin Odersky2013-11-141-36/+72
| | | | | | | | | | 1) Mappers and Accumulators now reduce typerefs over refinements but do not follow general type args Following type args in asSeenFrom leads into trouble because it specializes covariant aliases too early. A later as seen from might specialize the same alias with a more specific type. 2) The isDependent test in method type now uses a custom accumulator, because it needs to not flag erroenously types of the form p.T where p is a method paramater and T is a type parameter if `p`'s type which is aliased to an argument type. It should consider the argument type instead. With the change to 1), this broke, and is fixed by 2). 3) Unstable prefixes in member are widened.
* Debug measure: Report all errors when they are first issuedMartin Odersky2013-11-141-1/+3
|
* Make undetVars a set with deterministic traversal order.Martin Odersky2013-11-141-1/+1
| | | | Needed for replayability.
* widen if unstable prefixMartin Odersky2013-11-133-5/+16
|
* Fixing a problem in <:< of named types.Martin Odersky2013-11-131-15/+53
|
* Bringing underlyingIfRepeated up-to-dateMartin Odersky2013-11-113-3/+5
| | | | Was still using the old-alias scheme, which is ineffective now.
* Dealias before add to constraint.Martin Odersky2013-11-102-4/+16
| | | | We need to dealias any bounds before adding it to the constraint because otherwise we might have added a constraint X <: X in disguise.
* Reporting max constraintMartin Odersky2013-11-103-24/+28
| | | | Instead of throwing an exception if SImpleMap size goes over some threshold, we now report the largest constraint encountered in a run.
* Fixing Position.contains(NoPosition)Martin Odersky2013-11-091-2/+1
|
* Fixing inference problem and block scope problemMartin Odersky2013-11-075-19/+17
| | | | | | 1. Typing blocks: forgot to create new scope. Now fixed. 2. The decitsion whether to interpolate a type variable was made based on the type variable's position and the current tree's position. This is too imprecise, because we might have auto-generated trees where all important parts have the same position. We now check for actual tree containment: A type variable can be interpolated for the type of a tree T if T contains the tree which introduced the type variable.
* Fixing NoPosition leaksMartin Odersky2013-11-072-11/+35
| | | | Previously, some trees could contain subtrees with NoPosition. This happended when a tree had both positioned children and other children with NoPosition. When setting the synthetic position of a tree, the NoPosition children were not visited.
* Adding a size method to SimpleMap.Martin Odersky2013-11-061-0/+8
|
* Fixing several type checking problems.Martin Odersky2013-11-064-53/+105
| | | | | | | | | | | | | | 1. Being more precise what gets forced when. 2. stopping repeated evaluation when inserting an implicit methods to make arguments match. Previously the argument got re-evaluated which could lead to misleading errors (e..g missing parameter type if argument was a closure), and could also lead to exponential checking blowup. We now re-use the old argument but in its unadapted form. We do this with a tight coupling between an Application node and a FunProto node - typedArg in the application node forwards to new caching functionality in the FunProto node. It would probably be better overall to merge the two abstractions. FunProto = Application? 3. Various fixes to pattern matching.
* Fixing a typerstate confusion in implicit search.Martin Odersky2013-11-061-1/+1
| | | | Typerstate needed to be exploring.
* Special-casing printing of `_` Idents.Martin Odersky2013-11-061-1/+1
| | | | These don't have a symref in their .tpe, so we should just print `_` instead of the type of the tree.
* Avoiding to record constraints of the form P <:< P.Martin Odersky2013-11-062-2/+5
| | | | This will become redundant once poly params and typevars are identified.
* Changing for-expansion for irrefutable patterns.Martin Odersky2013-11-061-10/+33
| | | | | | p <- xs for irrefutable pattern `p` used to be expanded to `xs.withFilterIfRefutable`, now is expanded to just `xs.withFilter`.
* Adding a Scala2x flag.Martin Odersky2013-11-062-0/+4
| | | | A new flag to help us distinguish classes unpickled from Scala from classes defined in Dotty. Concrete use case: We need to use relaxed (and unsound) rules for pattern matching Scala2x case classes.
* Fallback to old treatement of tuples.Martin Odersky2013-11-042-6/+23
| | | | For interoperability we will keep for the time being the traditional treatment of tuples as instances of Tuple 2… Tuple 22. The new hlist-like treatment will be done in a future step. The flip is controlled by variable "unboxedPairs".
* Upgraded handling of positionsMartin Odersky2013-11-046-9/+44
| | | | It turned out the some trees were still carrying NoPosition in their pos fields. The new treatment avoids that and aslo adds some assertions to check for regressions.
* Added capability to print tree positionsMartin Odersky2013-11-042-0/+3
| | | | Controlled by option -Yprintpos