| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
... by reverting a premature optimization in Erasure.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Partial revert of 08c6eaca "this type is a term ref to the source module". The problem with
doing this is that it introduces spurious outer references. An inner module that contains
self referenves always needs the directly enclosing class. The revert avoids this dependency
by making ThisTypes always point to TypeRefs.
Several other changes were necessary to make the builds pass: TypeRefs had to get prefixes after
erasure so that they can be reloaded. Symbols of such typerefs had to be retrieved without forcing
a denotation.
One test (blockescapes.scala) fails and is moved to pending, awaiting further resolution.
Also two other new tests in pending which currently fail (and have failed before).
|
|
|
|
|
|
|
| |
t6574 has a new test where we produce identical code in an if-then-else. This broke
the rewiring logic before, and is fixed now.
Also, more comments and test cases.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
The first part of a type ascription e: T can be a pattern or an expression. The mode
has to be kept depending on what it was on the outside.
|
|
|
|
|
|
|
| |
Needed to wrap a dummyTreeOfType in a TypedSplice to prevent re-typechecking. (In fact, the
"tree without pos" check revealed a deeper problem: DummyTrees of types could be typed again,
but without the surrounding TypedSplice, the originally stored type would be forgotten and Null
would be returned.
|
| |
|
|
|
|
| |
"_" type paraeters need to be given fresh names.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This was a hard nut to crack. The problem exemplified by t2429 is that in a situation like
val x: T = foo(...)
where `foo` needs implicit parameters the expected result type `T` is propagated into the
typechecking of foo(...) and consequently also into the implicit parameter search. This
is often necessary, for instance to instantiate type parameters. But it can lead to overconstrained
searches if in fact the right expansion is
val x: T = viewToT(foo(...)(implicit params))
where `viewToT` is some implicit conversion. The fix handles that case by re-hecking the
application foo(...) with an empty result type, if the implicit parameter search fails.
But the re-checking is very subtle as is explained in the comment to `TyperState#tryWithFallback`.
|
|
|
|
|
|
|
|
| |
Fix so it isn't.
This caused an error in ErrorReporting because we do not propagate
bounds into a type like ValOrDefDef[_]. Error in `ErrorReporting` is now fixed but the problem is
reflected in test case `boundspropagation`.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There's a delicate balance about how much of a prototype should be passed down the
tree when typechecking. Passing little can cause ambiguity errors (both in overloading
and in implicit search). Passing too much can cause spurious errors because implicit conversions
"down the road" that apply to some tree continaing the result might not be considered.
Symptoms of the problems wree that we could not handle the tests included in this commit before.
The new scheme is as follows: we always keep all available information in a prototype, but hide nested
prototypes behined a `IgnoredProto` wall. These trees will not be considered for conformity checking.
When type checking hits an ambiguity, it tries again with a prototype that's one level deeper (has fewer
Ignore links) than the previous one. This continues until there are no more Ignore links to unwrap.
We also generalize the scheme for wrapping qualifiers of select nodes from realApply to all instances where
we compare against a FunProto.
Finally, there are some fixes that avoid assertion violations that were provoked by the new typechecking scheme.
|
| |
|
| |
|
| |
|
|
|
|
| |
t0786 works again after type inference fixes. Re-enabling.
|
| |
|
|
|
|
| |
stripImplicits needs to take polytypes into account.
|
|
|
|
|
| |
baseTypeWithArgs now also keeps track of refinements in the subtypes. Without
that, the approximated lub in t1279a is too coarse and the program fails to typecheck.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(and also of t0625, which reappeared).
Several fixes were made. In summary:
1. Naming and representation of KigherKinded traits changed. It's now $HigherKinded$NIP where
the letters after the second $ indicate variance (N)egative, (I)nvariant, (P)ositive. The HKtraits
themselves are always non-variant in their parameters.
2. When deriving refined types over higher-kinded types, the variance of a type alias
is the variance of the new type constructor.
3. isSubTypeHK was changed, as was the position from where it is called.
4. appliedTo also works for PolyTypes.
|
|
|
|
|
|
| |
The type of self name "x" was taken to be the thisType of the current owner.
But the current owner was a local dummy of the class in question, so the ThisType
was NoPrefix. Inserting an enclosingClass fixes the problem.
|
|
|
|
|
|
|
|
| |
The original test is now in error because the type Meta in the prefix Meta#Event
is not stable and contains an abstract member Slog.
Even after removing Slog, the test in pos was still in error because the bound type parameters
were incorrectly recognized as abstract members. This has been fixed by the changes to Types.
|
| |
|
|
|
|
|
|
| |
Method type comparison via <:< yielded false if the signatures of the two method types differed.
This is too strict, because methods can have the same parametyers but different result types and still
be in a subtype relationship. We now onyl demand that the sighatures have the same parameters.
|
|
Added more tests which all pass, except for tests in disabled and pending.
t0694 went from pos to neg, because the kind of alias type used in t0695 is no longer supported.
|