| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
Added several forms of "select" and "appliedTo" methods which construct Select, Apply, TypeApply
trees.
Motivation: Infix methods allow chaining which is more legible than deep nesting.
|
|
|
|
|
|
|
|
|
|
|
|
| |
New phase for extension methods.
Also, split off some type handling functionality that can be used
elsewhere in new TypeUtils decorator. The idea is that TypeUtils should
contain methods on Type that make sense specifically for transformations.
That way, we can keep Types from growing. Might make sense to do similar
decorators for Denotations as well.
There's a bug fix in MacroTransform: Need to treat selfInfo varDels specially, since they have no symbol.
|
|
|
|
|
|
|
| |
- 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
|
|
|
|
|
|
|
|
|
|
|
|
| |
1) We now always generate companion objects for classes. This is done in
mini-phase "companions", which also assures that companion-modules appear
after companion-classes.
2) PostTyperTransformers is gone; the part which normalizes trees has been
rolled into TreeTransform and the part which reordered companion classes
and modules is now in Companions.
Note: Some tests were deisabled; should be re-enabled by Dmitry where needed.
|
|
|
|
|
| |
d.T is an access to a structural type member, so rejecting this is OK. Not sure why we compiled
this before without warning.
|
|
|
|
|
|
| |
The problem is that when an installAfter completely replaces a previous denotation, a symbol or NamedType
might still hang on to that denotation in the cache. We need to enforce that we switch to the new denotation.
This is done by setting the replaced denotation's validFor field to Nowhere.
|
|
|
|
|
| |
... for the common supertype of MethodType, PolyType, and ExprType.
Signed was confusing.
|
|
|
|
|
| |
Rewrote SuperAccessors (more to be done; see comments), and
added stuff here and there to make it work smoother.
|
|
|
|
|
|
| |
(1) Make sure ModifierFlags is TermFlags and TypeFlags
(2) Shorten private <local> to private[this]; same with protected
(3) Print [this] for local symbols in RefinedPrinter
|
| |
|
|
|
|
| |
Added this case, so that .symbol on a ThisType returns the underlying class.
|
|
|
|
|
|
|
|
|
| |
Added the following utility methods:
- polyDefDef: Create a DefDef given a function that takes type and value parameters and yields a body.
- appliedToTypeTrees: Apply function to type arguments ion a TypeApply if arguments are nonempty.
- mkAsInstanceOf
- ensureConforms: generate a cast if expression has non-conforming type.
|
| |
|
|
|
|
| |
Should do the same with other name-creator/name-test pairs.
|
|
|
|
|
| |
This is done to streamline changing class denotations in new phases
by adding to (or otherwise modifying) their decls scope.
|
|\
| |
| | |
Fix using of wrong period for creating nested ctx in TreeTransforms
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
`owner` for nestedContext in `TreeTransforms` was assigned
using initial period of whole `TreeTransforms` block.
That is incorrect as denotation for this owner could have been
create by some phase in this block.
|
| |
| |
| |
| | |
No need to perform zero transformations.
|
| |
| |
| |
| | |
There is no need to recurse in tree if there are no transformations left.
|
|\ \
| |/
|/| |
Docs/higher kinded v2
|
| |
| |
| |
| | |
Adapted docs so that they reflect what has been implemented.
|
| | |
|
| | |
|
| | |
|
|\ \
| | |
| | | |
Change/higher kinded
|
| | |
| | |
| | |
| | | |
Closes #94.
|
| | |
| | |
| | |
| | | |
Added explanations where suggested by Adriaan in his review.
|
| | |
| | |
| | |
| | |
| | | |
Avoid special treating TermRef, as this is not demanded by the
comment and does not change any of the test outcomes.
|
| | |
| | |
| | |
| | | |
Guard every occurrence of name.head with a test whether name.length > 0
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
TypeVars flip from the initial state, where underlying == origin to the final state
where underlying == inst. This flip can invalidate information that depends on the underlying
type of a TypeVar. Since we do not know when the flip occurs, we need to avoid keeping
any such information in a cache.
The commit makes three caches depend on a new value: typerState.ephemeral. The value is
set to `true` each time we follow the underlying type of a TypeVar, and this disables cached
information to be retained.
A test case for this commit is t2693.scala. This test passes typechecking with the previous commit,
but fails in -Ycheck:front because of stale cache info in an "#Apply" typeref. The present commit fixes that.
|
| | |
| | |
| | |
| | | |
refines needs to be made more stable, so that also aliases and derefernces typevars are recognized as prefixes.
|
| | |
| | |
| | |
| | | |
Was not called when comparing a named type with an #Apply projection. The commit fixes this.
|
| | |
| | |
| | |
| | |
| | |
| | | |
1) Honor variance of Apply and $hkArgs when instantiating them
2) Eta-lifting a higher-kinded type is straight eta expansion,
no arguments are applied.
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | |
| | | |
Switch to the new scheme where higher-kinded types (and also some polymorphic
type aliases) are represented as instances of Lambda traits.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Refined type subtyping needs to take into account all information
that was seen about members of both refined types. This is handled by
storing context info in `pendingRefinedBases` and making use of this
to selective rebase qualifiers when comparing refined types.
Note: This commit fails in pos/collections and dotc/ast, presumably because
of bad interaction between the refined subtyping and the "matchingNames" logic
(which will go away).
|
| | |
| | |
| | |
| | |
| | | |
In case of "types differ" failure, explain why original and retyped type are
not subtypes of each other.
|
| | |
| | |
| | |
| | |
| | | |
Printing a type parameter reference `A#T` now only reduces to `T` if
`A` is some `B.this.type`.
|
| | |
| | |
| | |
| | |
| | | |
Avoid to reduce projections `A{ ... }#T` to aliases if the
alias would refer to abstract members of the refinement type.
|
| | |
| | |
| | |
| | |
| | | |
Now also works for symbols that are not class members (and returns
Iterator.empty for them).
|
| | |
| | |
| | |
| | |
| | |
| | | |
Apply cannot be treated as a type parameter because it does not count
towards the number of legal arguments in an instantiation of a higher-kinded
type.
|
| | |
| | |
| | |
| | |
| | | |
Make sure that Lambda Arg refinements have the same variance as the Lambda classes
they instantiate. Controlled by a Config parameter.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Type members used to always pick the last refined info for a type name.
This is incorrect, as a type might have several refinements for the
same type name, which are not necessarily subsumed by the last one.
We now only pick the last one if it is an alias type (assuming we check
for conflicts elsewhere).
|
| | |
| | |
| | |
| | | |
... to bring it in sync with equals.
|
| | |
| | |
| | |
| | | |
Testing whether a type is (a subtype of) a Lambda class.
|
| | |
| | |
| | |
| | |
| | | |
Adding names and definitions for the Lambda scheme to hk types.
Also add HigherKinded flag for HK type parameters and abstract types.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
abstract type.
This is needed to make the encoding og higher-kinded types work. E.g.
Rep[Int]
would be represented as
Rep { type Arg$0 = Int } # Apply
where Apply is an abstract member of the base class Lambfa$I of Rep.
|
|\ \ \
| | | |
| | | | |
Use the final scala 2.11.
|