| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
| |
Also, make binder type of SkolemType refer to arbitrary type,
not necessarily RefinedType.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In the end, this did not buy us anything. What matters is that
- we can reliably identify RefinedThis types pointing to a given
refinement type. Making sure that the `binder` field of q RefinedThis
type in a refinedInfo is always the containing refined type is good
enough for that.
- we take care to rebind RefinedThis types in isSubType. This was leaky before,
is handled now better in the new isSubType.
So, in the end, adding a level was a needless complication. Also, as a next step
we should be able to identify skolem types and RefinedThis types.
|
| |
|
|
|
|
|
| |
Checks are no longer interesting because we will not to migrate to
RefinedThis(level) scheme after all.
|
|
|
|
|
|
|
|
| |
Since the binder field in RefinedTypes should not be significant for
subtyping, we need to substitute RefinedThis types away before comparing
refinements. But this substitution is only done in the slow path.
The fix falls back to the slow path if a refinement
refers to the refined type via a refined this.
|
|
|
|
| |
Move non-essential code to diagnostics plus some other small cleanups.
|
|
|
|
| |
See comment for an example what changes.
|
|
|
|
|
| |
Dropped a member calculation which was unncessessary and which would not work
anymore if RefinedThis types lost their RefinedType target field.
|
|
|
|
|
| |
A configuratin now decides whether fast path is taken or not. That way
we can more easily test either way if something goes wrong.
|
|
|
|
|
| |
The previous idea to keep original types around in `origN` types
to be accessed from nested methods was not needed in the end.
|
|
|
|
|
| |
As before, optimize for the case where correspnding refinements
have the same name and the lower one is a type alias.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
After last commit, dotc/config died with the "isSatisfiable" assertion
in TypeComparer. The problem was that when deeling with a variable/variable
constraint
A <: B
we treated this as the two independent actions of adding
A <: B
B >: A
But this means we no longer have a clean inductive satisfiability check before
something gets added - A <: B gets added before the satisfiability check of B >: A
is started. The fix splits satisfiability check and actual constraint update in
two separate actions.
|
|
|
|
|
|
|
|
| |
Since we cache the information whether a refinement contains RefinedThis
occurrences to the refinement itself, we can use this info to avoid substututing
RefinedThis types. Used in findMember and hasMatchingMember.
The commit uncovered an issue with constraint handling that will be fixed in the next commit.
|
|
|
|
| |
... into a new trait "Skolemization".
|
|
|
|
| |
Now that new scheme works we can drop the alternative.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The previous scheme did not ensure that transitivity was eliminated.
Example scenario:
We have in the constraint
P <: Q
for constrained variables P, Q and add
Q <: T
Previous propagation added the constraint and then tested
whether the bounds of all variables were satisfiable. For
Q we test
P <: T
but that is true because P <: Q and we already added the constraint Q <: T.
So we fail to add the constraint P <: T, and transitivity is no longer eliminated.
Instead we now test the new bounds (in this case P <: T) *before* adding
the new constraint Q <: T. This is also simpler than the previous scheme.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Instead of rebasing, use the DeBrujn level of a RefiendThis.
- Make sure lower type is a singleton by skolemizing it if necessary.
- Do the correct rebinding of the upper type's RefinedThis.
Remarks:
- The new scheme discovered quite a lot of errors which are mostly fixded in
other commits of this branch. i0268 (GADT matching) still does not work, moved to pending.
- Some optimizations are currently missing:
(1) fast path refined subtyping
(2) faster operations for substituting refined thistypes which
explot the fact that RefinedThis is relatively rare.
|
| |
|
|
|
|
|
| |
We will need that at some point because type checking refined types will generate skolem
variables for representing RefinedThis types if the lower type is not a singleton.
|
|
|
|
|
|
| |
Symptom was: When compiling Definitions.scala with the changes in the subsequent
commits, an empty tree was passed as implicit parameter, without an "implicit not found"
error being reported. The problem needed a fix in TyperState.
|
|
|
|
|
|
|
|
| |
Cyclic reference was caused when compiling pos/i94-nada.scala with
typer = new Printer
and -Yfront set.
|
|
|
|
|
|
| |
When doing a findMember we now look at the level of a RefinedThis instead
of its `rt` field. This required several fixes to how levels are assigned
to RefinedThis types.
|
|
|
|
| |
Temporary solution for better diagnsitics.
|
|
|
|
|
| |
Capture original types in enclosing scope instead of passing them
explicitly.
|
|
|
|
|
|
|
|
|
| |
Given
class C { type T }
C { type U = this.T } { val x: U }
the second refinement does refer via the alias to the refinement type itself.
|
|
|
|
| |
That way we profit from caching.
|
| |
|
| |
|
|
|
|
| |
Plus, RefinedThis gets a second parameter, `level`. This will replace the first one in due time.
|
| |
|
|
|
|
|
|
|
| |
Cases handled are:
Null <: (A & B) { ... }
Null <: (A | B) { ... }
|
|
|
|
| |
Moved working tests to pos, annotated non-working ones.
|
|
|
|
| |
Move some tests into proper slots + comments what they are.
|
|
|
|
|
|
|
|
| |
scalac has the same restriction. The reason is that we do not have a means
to specify a sequence-valued default for a vararg parameter.
It would be nice if we could, but this requires a more substantial development
effort.
|
| |
|
| |
|
|
|
|
| |
isUnboundedGeneric imples !JavaDefined anyway.
|
|
|
|
|
| |
Fixes problem in test case SI-7638a.scala which gave an
override error before.
|
| |
|
| |
|
|
|
|
| |
Moved some working test to pos. I wonder why they were in pending? They did work for me.
|
|
|
|
|
|
| |
The problem was that, unlike a classDefSig, a higher-kinded typeDefSig did
not get a preset info with its type parameters. So any type-application
of the defined type in its bounds would fail.
|
|
|
|
|
|
|
|
|
| |
I get very frequent build failures due to the mutual Scala<->Java dependency.
It builds for a long time, then decides that getCtx overrides nothing. The only
way to fix is another clean build. Total time lost: >5 minutes. These happened
occasionally before but have become much more frequent under ScalaIDe4.0, to the
point where this becomes a major drag on productity. Context escape detection
is nice but if it stops us getting work done, not worth the effort.
|
|\
| |
| | |
Fixed #264 - failure to typecheck GADTs
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
|\ \
| | |
| | | |
-Ylog:X now only log phase X, use -Ylog:X+ to also log phase X+1
|
| | | |
|
|\ \ \
| | | |
| | | | |
Simplify TypeAlias#unapply
|