| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
This PR investigates what it takes to extend CollectionStrawMan5 to
arrays.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Faced with recursive dependencies through self types, we might have
to apply `normalizeToClassRefs` to a class P with a parent that is not
yet initialized (witnessed by P's parents being Nil). In that case
we should still execute forwardRefs on P, but we have to
wait in a suspension until P is initialized.
This avoids the problem raised in #1401. I am still not quite sure
why forwardRefs is needed, but it seems that asSeenFrom alone is not
enough to track the dependencies in this case.
|
|\
| |
| | |
Fix #1378: Propagate more knowledge of result type into applications
|
| |
| |
| |
| |
| |
| |
| |
| | |
If an application has functions with implicit parameter types we need to be
more aggressive about propagating knowledge of the expected result type into
the constraint.
Fixes #1378.
|
|\ \
| | |
| | | |
Fix wildcard protos
|
| | | |
|
|\ \ \
| |/ /
|/| | |
HK reduction: Remove special-case for typerefs
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The special case:
case stripped: TypeRef =>
stripped.symbol.is(BaseTypeArg)
is wrong because you might still want to reduce applications involving
TypeRefs which are not base class parameters, like in:
class Foo[A]
type Alias[X] = Foo[X]
val x: Alias[Int] = ???
`Alias` is a TypeRef so before this commit `Alias[Int]` was never reduced
to `Foo[Int]`. It should have been:
case stripped: TypeRef if stripped.symbol.is(BaseTypeArg) =>
true
But even this is incorrect: it assumes that we can always safely reduce HK
applications involving base class parameters, this is not the case when
the parameter kind is different from the rhs kind as illustrated by
`i1181c.scala`. We fix this by simply dropping the special case.
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Now that we implement partial higher-order unification (SI-2712 fix)
i1181.scala will compile even if `Alias[Int]` gets dealiased to
`(Int, Int)` because we can unify the latter with `M[_]` where
`M = [X] -> (Int, X)`.
The new test will only succeed if `Alias[Int, Int]` is not dealiased
because we will never unify `Foo[Int]` with `M[_,_]`.
|
|\ \
| | |
| | | |
Fix #1386: Reduce double def errors
|
| | | |
|
|\ \ \
| | | |
| | | | |
Fix typing of match expressions
|
| | | | |
|
| | | |
| | | |
| | | |
| | | | |
Also fix reviewers comments about `firstParent`
|
| | |/
| |/|
| | |
| | |
| | | |
Allow matches between unapply types and selector type where a possible
overlap might exist.
|
|\ \ \
| |/ /
|/| | |
Changes to overloading
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | | |
Adds the original test form #1381. t2660 looks similar.
Also adds some unrelated tests I had in the queue that now
compile.
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | | |
Fix #1381: Overloading is now changed so that we first try without implicit searches.
Only if that leaves no applicable alternatives we try again with implicit search turned on.
This also fixes test case t2660, which got moved from neg to pos.
|
|\ \ \
| | | |
| | | | |
Fix 1365: Fix bindings in patterns
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
We need to compare pattern types with expected types in order
to derive knowledge about pattern-bound variables. This is done
use the mechanism of gadt bounds.
|
|\ \ \ \
| | | | |
| | | | | |
Add scala.Dynamic support.
|
| | | | | |
|
| | | | | |
|
| |/ / / |
|
|\ \ \ \
| |_|/ /
|/| | | |
Implement -Yno-predef and -Yno-imports
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
* Implement flags -Yno-predef and -Yno-imports
* Add unit tests for both
|
|\ \ \ \
| | | | |
| | | | | |
Direct representation of higher-kinded types
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Enable checking of bounds when comparing type lambdas. This invalidates
a pattern used in t2994 and potentially other code, where a bound [X] -> Any
is used as a template that is a legal supertype of all other bounds. The old
behavior is still available under language:Scala2.
|
| | | | | |
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Previous logic could only handle classes as constructors.
Also, address other reviewers comments.
|
| | | | | |
|
| | | | |
| | | | |
| | | | |
| | | | | |
This was fixed two commits ago.
|
| | | | |
| | | | |
| | | | |
| | | | | |
Allow hk type parameters to be higher kinded themselves.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
When applying a type alias of a type lambda, keep the original
application instead of reducing. But reduce anyway if
- the reduced type is an application where the type
constructor has the same kind as the original type constructor, or
- some of the arguments are wildcards.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Allow definition of types in refinements that do not appear
in parent type.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Allows partially instantiated types as type constrictors when inferring higher-kinded
types.
|
| | | | | |
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
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]
|
| | | | |
| | | | |
| | | | |
| | | | | |
Also, fix error counts in tests for new hk scheme.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
- 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.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
We would like to change from a scheme where eta-expansion was
prototype driven to one where unapplied parameterized types are always
eta expanded. The reason is that we might miss some eta expansions due
to cyclic references.
run/colltest4
is an exmaple. Here, we missed an eta expansion in the type of Iterator.
The class definition is:
trait Iterable[+A] extends IterableOnce[A] with FromIterable[Iterable] {
We'd expect that the second parent would expand to
FromIterable[[X0] -> Iterable[X0]]
But we miss the expansion because at the time we complete Iterable we have not
completed FromIterable yet. In fact this happens in both the old and the new hk scheme.
But in the old scheme we did not notice the error whereas in the new scheme we
get an error in PostTyper that the type Iterable does not conform to its bound
`[X0] -> Iterable[X0]`.
With this commit, we change the scheme, so that eta-expansion depends on the
type parameters of a type itself, instead of the expected type.
We should investigate whether we can do a similar change for Scala2 classloading.
Check kinds of type parameters
Also, do not allow a hk type if the bound is a * type.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
The new one only reduces straight applications of type lambdas with
definite arguments. It is called very early on appliedTo, and derivedRefinedType.
The old one, now renamed to normalizeHkApply also handles wildcard arguments
and can garbage collect general unneeded hk-refinements. It is called later, at various
places.
TODO: See what functionality of normalizeHkApply should go into betaReduce instead.
Maybe we can even drop normalizeHkApply? However: need to be careful to maintain aliases
for hk type inference.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
With this change, ski compiles (but with more errors than before).
Without it, it goes into various infinite recursions.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Map self-references in refinements to recursive types. This
commit does this for refinement types appearing in source.
We still have to do it for unpickled refinements.
Test apply-equiv got moved to pending because it simulates
the old higher-kinded type encoding in source, which relies
on the old representation in terms of self-referential refinement
types. The plan is not to adapt this encoding to the new
representation, but to replace it with a different encoding
that makes critical use of the added power of recursive types.
Use recursive types also when unpickling from Scala 2.x.
Add mapInfo method to Denotations.
|
|\ \ \ \ \
| |_|_|_|/
|/| | | | |
Skip redundant superclasses\supertraits.
|
| |/ / / |
|