| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Allows partially instantiated types as type constrictors when inferring higher-kinded
types.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
If there is a new named type param scheme it will almost certainly not
need something like compareAliasedRefined.
Also: harden printer to compute less and thereby avoid
a possible NPE.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
It seemed more cohesive to keep the concepts of "instanceType"
and "approximation" side-by-side.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Gave several times improvement for linker.
|
| | | | | | |
|
| | | | | | |
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Previously, a unified or otherwise instantiated type parameter
would be removed from the constraint, i.e. if it was the
last parameter of its polytype to be instantiated, the polytype
would be dropped. This is a potential problem since it means
that the alias `param = instance` is forgetten whereas we might
still need it in the same subtype test sequence.
The solution is to wait with cleaning up polytypes until
all associated type variables are fully instantiated.
This change uncovered another bug, where we failed
to follow an existing instantiation when adding to
a constraint. This manifested itself in deep subtype
errors for run/colltest1 and some others.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
We cannot handle such types in general. So we now check that a hk application
C[args]
where some of the arguments are wildcards does not have as a supertype
a hk application
([X] -> B)[args]
|
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Printed as <notype> before.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
The previous implementation of `replace` made it possible that formerly constrained
parameters would stay on embedded in bounds of other constraint enrties.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Allows us to drop also the involved knownHK method. Lots of other
cleanups.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
1. Make genericType a trait instead of a class.
2. Make TypeLambda a type proxy
3. Split underlying in TypeProxy into underlying and superType
4. Cleanups in many other places
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
We needed fairly specific code to make the refinement based
hk encoding work without cyclic references. With the new
encoding these complications are no longer needed.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Eliminate sameParams, add comments.
Also, minor cleanups elsewhere.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Only use one method instead of a succession of two.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Under direct hk encoding this is no longer needed.
Also, drop now redundant pieces of widenForMatchSelector.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Taking the signature over a type with uninstantiated type variables
means that the signature can change later, once we instantiate the
type variable. We handle this by recording uninstantiated positions
of signatures and fixing them in PostTyper, when type variables are
instantiated.
- This allows to drop the kludge of "normalizing" in derivedRefinedType
Dropping this initially revealed the problems with under-determined
signatures. Now that these problems are fixed, we can drop for good.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Remove the code that implemented the encoding of hk types
using refinements.
Drop the notion that RefinedTypes can be type parameters. This is
no longer true under the new representation.
Also, refactoring MemberBinding -> TypeParamInfo
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
- Make printing package ids more robost
Crashed before when printers were turned on during test pickling mode.
- Make Denotation#bringForward more robost
Assertion failed before when printers were turned on during test pickling mode.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Parameter names always come in as term names, ahve to be explicitly
converted to type names. The previous implementation used a cast instead
of a conversion, which caused a ClassCastException. For symmetry we model
readParamNames such that it returns a List[Name] which has to be explicitly
converted to a List[TermName] or a List[TypeName], using a map.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
The deleted assertion could fail for code that was
erroneous.
- Enable new hk scheme.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Done for efficiency. Also that way we would do something
meaningful if the type constructor was, say, Nothing.
However, that case is now rules out anyways.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
- Follow aliases in isMatchingApply
- Avoid comparing with TypeBounds in compareHkApply
- Generalize kind adaption in liftIfHK
Previously we only covered EtaExpansion/reduction. Need to
generalize this to the case where a type is partially applied.
Test case is pos/partialApplications.scala
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Keep the higher-kinded application instead. This should be
better for inference. We have to evaluate the performance impact.
Maybe dealias if the kind stays the same?
Also, reduce Nothing[...] to Nothing
Nothing cannot be a type constructor in a
HK application because it does not have type
parameters. Avoid the problemn by the reduction above.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Also, fix error counts in tests for new hk scheme.
|
| | | | | | |
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
- Follow upper bound, as before.
- But if type constructor is a lambda, needs
special treatment.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Makes pos/partialApplications compile.
- Fix appliedTo for aliasTypes
Returned a general TypeBounds instance before.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
The problem is that some existential types read from Java (and Scala
as well? not sure) appear as naked typerefs. They consequently get
expanded via eta expansion to type lambdas. This commit compensates for
this by collapsing an eta expansion if this can make a subtype tests succeed
or a union or intersection be legal.
Also, take hk types into account for liftToClasses
Needs to special-treat TypeLambda and HKApply since otherwise
we risk creating malformed And-types.
|
| | | | | | |
|
| | | | | | |
|
| | | | | | |
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Under the new hk scheme we discovered that type parameters
are sometimes unpickled in the wrong order. The fault was always
present but the previous hk schemes were somehow lenient
enough in their subtyping rules to not discover the problem.
E.g., when reading Coder.scala, dotc believed that parameter
`A` of `TraversableOnce#BufferedCanBuildFrom` is higher-kinded
and parameter `CC` is first-order where the opposite is true.
This commit hardens the way we read type parameters in order
to make this swap impossible by design.
- Revert auto-healing in derivedAppliedType
The healing hid a real error about order of type parameters
in Scala2 unpickling which was fixed in the previous commits.
The healing caused Map.scala to fail because it is possible
that type parameters are mis-prediced to be Nil in an F-bounded
context.
- Smallish fixes to type applications
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
With the change in the next commit this addition is needed
to make i859.scala compile. Previously the same effect was
achieved accidentally by `updateTypeParams`. The comment
admits that we do not really know why the functionality is needed.
|
| | | | | | |
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
When approximating the constructor of an ak apply to a wildcard
type, approximate the whole application by WildcardType. Otherwise
we might have a wildcardtype with hk bounds as result.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
It's now the same as upperBound, i.e. the underlying of the
type constructor re-applied to the arguments.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
- Allow appliedTo over TypeBounds
- Difference in handling of empty type parameter lists
- Always consider EtaExpansions in appliedTo
EtaExpanions were not simplified before in Coder.scala and collections.scala.
Need to come back and simplify appliedTo logic.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Make them each inherit from common BaseType GenericType.
That way we avoid inheriting accidentally stuff from PolyType in TypeLambda.
Also, Fix adaptation of type lambdas. Don't confuse them with PolyTypes.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
- Handle hk applications in normalizeToRefs
- Handle type lambdas in classSymbol(s)
- Fix variances computation in type lambdas
- Provide type parameters for uncompleted type lambdas
- Revert TermOrHK type characterization
|
| | | | | | |
|
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Add existential type elimination for HKApply
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Bounds did not do the right thing if a constrain parameter
was aliased.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
- Re-introduce newHK option. Label some things that will be
removed with OLD.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
- Simplify RefinedType
- Drop recursive definition of RefinedThis - this is now
taken over by RecType.
- Drop RefinedThis.
- Simplify typeParams
The logic avoiding forcing is no longer needed.
- Remove unused code and out of date comments.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
- Swap order of subtype tests
The theory is that if two refined types have the same refined name, then
they are likely to be of related classes. So it seems more fruitful to
check the argument before the typeconstructor because that way we test
the part that's more likely to fail first. Rough observations seem to
indicate a 3% improvement in the junit test time.
- Cleanups
Drop some unnecessary cases; improve comments.
- Smarter handling of LazyRefs in betaReduce
Try to combine type constructor and arguments under a
common LazyRef.
- Optimize RecType/RecType comparisons
- Fix compareHkLambda, make it check variances.
|
| | | | | | |
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
- compileMixed failed because there was a cycle between immutable.Seq (compiled) and
parallel.ParSeq (loaded from classfile). Inspection of the completion log (turn completions
Printer on) and the stack trace showed that there's nothing we can do here. The old hk scheme
did not go into the cycle because it did not force an unrelated type. I believe with enough
tweaking we would also hva egotten a cycle in the old hk scheme.
The test is "fixed" by adding parallel.ParSeq to the files to compile.
- Disable named parameter tests
Those tests do not work yet with the revised hk scheme.
Before trying to fix this, we should first decide what parts of
named parameters should be kept.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Without this step, anonymous functions can have dependent
types which causes the parameter references to "leak out"
to types in the environment in illegal ways. This caused
a tasty failure for Typer before (not sure why the failure
was not observed under the old hk scheme).
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
TypeMaps do the same, so it is logical, and helps
prevent subtle errors as when we mispredicted whether
a RecType contains references that point to it.
Also, add normalizeHkApply to homogenize
Fixes some discrepancies in Tasty typing.
Also, homogenize skolem types
Skolem types are eliminated by pickling, so they should not appear
in the "before-pickling" output.
|