| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|\
| |
| | |
Check that some types are not higher-kinded.
|
| |
| |
| |
| | |
Invalidates #813. Review by @darkdimius.
|
|\ \
| | |
| | | |
Always fully define the types of lifted expressions
|
| | |
| | |
| | |
| | | |
Fixes #822
|
|\ \ \
| |/ /
|/| | |
Fix various issues in `TypeAssigner#avoid`
|
| | |
| | |
| | |
| | | |
Fixes #741.
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
When we need to avoid `A` in the class `A#B`, we can try to replace `A`
by a supertype. Previously, we only tried to replace `A#B` itself by a
supertype.
Fixes #711.
|
|\ \ \
| |_|/
|/| | |
Change inference
|
| | |
| | |
| | |
| | |
| | |
| | | |
We now also consider type variables in a selection prefix of the
application. The test case was augmented to include a snippet which
only succeeds under the generalization.
|
| | | |
|
|\ \ \
| |_|/
|/| | |
Change : freeze bounds
|
| | |
| | |
| | |
| | |
| | | |
Iter2.scala fails with 6 errors, but succeeds once lubs and glbs do not try to
unify under invariant type constructors.
|
|\ \ \
| |/ /
|/| | |
fix compiling ScalaRunTime.scala
|
| | | |
|
|/ /
| |
| |
| |
| | |
A test that checked for errors on overloading
now succeeds with the new rules.
|
| |
| |
| |
| | |
Fixes suggested by @marter when reviewing previous hk PR.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
It turns out that asSeenFrom can produce types
that get projected with $apply but that are not
higher-kinded. An exampple failure is in Iter3,
andother in scala.collection.immutable.Map (which is
now part of the test suite).
We now detect that situation, and eta expand the
projected type in `derivedSelect`, this will
force a subssequent `lookupRefined` which will give
the desired normalized type.
Also added is a configurable test that checks that
$apply projected tyeps are in fact higher-kinded.
|
| |
| |
| |
| |
| |
| | |
The original IterableSelfRec is not syntactically legal after
the hk changes. I attempted to fix, but there's still a type error.
Need to investigate whether this is a true error or a bug.
|
| |
| |
| |
| | |
...unless the HK type can be eta-reduced to a class type.
|
|/
|
|
|
| |
In Namer, eta expand any type argument that corresponds to a higher-kinded type parameter.
Also, check that all type parameter lists are fully applied.
|
|
|
|
| |
Desugaring worked incorrectly when both context bounds and default parameters were present.
|
|
|
|
|
| |
Tested are now other numeric values, strings, booleans, which are
all legal singleton types.
|
|
|
|
|
|
| |
As the comment in pos/singletons.scala says, we currently
test only constant propagation during typer. We should also have a
test that literalize produces the literals in the right places.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
VCInline is split into two phases:
- VCInlineMethods (before Erasure) replaces value class method calls
by calls to extension methods
- VCElideAllocations (after Erasure) handles == and optimizing the
unboxing of a boxed value class, as VCInline did before.
This should not affect anything currently, but in the future we will have
phases before Erasure that mangle names (like TypeSpecializer, see #630),
being able to put these phases after VCInlineMethods means that
VCInlineMethods does not need to know anything about how these phases
mangle names, this reduces the coupling between phases. The trade-off is
that VCInlineMethods needs to deal with type parameters and multiple
parameter lists whereas VCInline didn't.
|
|\
| |
| | |
Fix/dependent methods
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
Necessary to make implicit resolution of type-level peano numbers work.
The current commit makes takes the inimal steps to make this happen. We
could also consider sharpening using followAlias every type we constrain
a result, or every time we adapt a type.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
According to SIP 15 a value class C must obey the following restrictions:
C may not have secondary constructors.
C may not declare fields (other than the parameter of a value class).
C may not contain object definitions.
C may not have initialization statements.
These are enforced by this commit. We are still missing restrictions on
value class paremeters. We should review what the right set of conditions
is (probably we want to admit non-vals, and maybe even multiple
parameters).
|
|\ \
| |/
|/| |
Avoid junk produced by Constraint#replace.
|
| |
| |
| |
| | |
Uncomment two lines that were commented out by accident.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
There were two instances where a constraint undergoing a replace would still refer
to poly params that are no longer bound after the replace.
1. In an ordering the replaced parameters was n ot removed from the bounds of the others.
2. When a parameter refers to the replaced parameter in a type, (not a TypeBounds), the
replaced parameter was not replaced.
We now have checking in place that in globally committable typer states, TypeVars are not instantiated
to PolyParams and (configurable) that constraints of such typer states are always closed.
Fixes #670.
|
|\ \
| |/
|/| |
Fix checking whether types are instantiable.
|
| |
| |
| |
| |
| | |
The logic for checking aginst the self type was wrong, as demonstrated
by pos/checkInstantiable.scala.
|
| | |
|
|\ \
| |/
|/| |
Tighten comparison of skolem types
|
| |
| |
| |
| |
| |
| |
| | |
We want to establish the invariant (optionally checked by assertNoSkolems)
that symbols do not contain skolemized types as their info. This avoids unsoundness situations
where a skolem gets exported as part if the result type of a method, so different instantiations
look like their are the same instance.
|
|\ \
| | |
| | | |
Some fixes around mixin and memoization
|
| | |
| | |
| | |
| | | |
Implementations inherit all annotations on the implemented trait methods.
|
| |/
| |
| |
| |
| | |
The logic to add trait setters to Scala 2 traits was wrong. This led
to AbstractMethodErrors in the formerly commented out part of scala-trait.scala.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
It's easy to get this wrong. What happened was that when
computing deferred members of a class a deferred member
was preferred over a concrete one because the types did not match.
Thsi should not happen. We now change the scheme to always
prefer concrete over abstract, and subclass-owned over superclass-owned.
But we pick a denotation only if the overrides relationship on types
coincides with the preference on symbols.
|
| |
| |
| |
| | |
The tests in this commit pos were verified to work again.
|
|/
|
|
|
|
|
|
| |
A reference to an object from anywhere in its module class can be
established by the This of the module class. The previous behavior always
referenced the object as a term ref which might cause a reference to
the outer This which might not be available (since this is not tracked
by ExplicitOuter). Brings t3174.scala back from disabled.
|
|\
| |
| | |
Implement Scala2 traits
|
| |
| |
| |
| | |
We are still lacking the setup to do this right for mixed Scala 2/Dotty runtime tests. So I checked into `pos` for now.
|
| | |
|
|/ |
|
| |
|