| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
Iter2.scala fails with 6 errors, but succeeds once lubs and glbs do not try to
unify under invariant type constructors.
|
|
|
|
|
| |
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.
|
| | |
|
|/ |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Harmonization is Dotty's alternative to Scala 2's notion of weak conformance. It is less powerful but also
less entangled with the core type system. The idea is that in some specific contexts trees that
all have primitive numeric types will be converted as necessary so that they all have the same numeric type.
These tree sets are:
- the two branches of an if
- the alternatives of a match
- the body together with the catch blocks of a try
- the arguments of a vararg parameter
Examples are in the test file, harmonize.scala.
|
|
|
|
| |
Some of them were moved from disabled after verifiying that they compile now.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Adds IterableSelfRec.scala which caused lockup of the compiler.
After a lot of work the problem was determined to be polyomial or
exponential behavior of the compiler when executing findMember
on refined types that contain several bindings where the
resutling & causes a recursive invokation of findMember with
the same name. We do have a stop for this now, but if the
stop comes too late the runtime will grow very fast.
Problem addressed by kiccking in earlier with the stopping logic.
|
|
|
|
| |
The test case that caused all previous commits in this branch.
|
|
|
|
| |
Did not handle this case before.
|
|
|
|
|
| |
This mimics scalac's behavior (but not the official syntax; in fact the
official syntax seems to be ambiguous.
|
|
|
|
|
| |
Erasure#isUnbox was incorrect: the unbox methods are defined on the
value classes, not the boxed classes.
|
|
|
|
|
|
|
|
|
|
| |
object as owner and be followed by type arguments:
reflect.classTag[T]
expands to
reflect.`package`.classTag[T]
|
|\
| |
| | |
Fix #547: Vararg overload
|
| |
| |
| |
| |
| | |
When comparing to types in isAsSpecific, onvert repeated parameters to their underlying type
only if both types are vararg methods. This mimics scalac behavior.
|
|\ \
| | |
| | | |
Make dotty compile backend.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
We used to require that the result type of an extractor `get` is a product,
or else the type of the `get` itself would be taken as the result type of the
unapply. This is now relaxed so that we automatically select with _1, _2, ...
as soon as there are multiple argument patterns, and (1) the result type is not
a Seq, (2) the number of consecutive product conselectors matches the number
of arguments.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
It seems wasteful to load the member classes even of classes that are not currently compiled.
It also makes us vulnerable to any misinterpretation of Java file formats. In th particular
case of #536, we parsed a class an anonymous Collection$1 which was referring to the type
parameter of its enclosing class, but was not diagnosed as an inner class of the enclosing class.
|
|\ \ \
| |_|/
|/| | |
Fix #540 - unbounded array test for wildcard array arguments
|
| |/
| |
| |
| |
| |
| | |
Arrays with wildcard arguments such as Array[_ <: Foo] where Foo is a
universal trait are now diagnosed as unbounded generic arrays and are
erased to Object.
|
|/
|
|
|
|
|
|
|
| |
We used to require that the result type of an extractor `get` is a product,
or else the type of the `get` itself would be taken as the result type of the
unapply. This is now relaxed so that we automatically select with _1, _2, ...
as soon as there are multiple argument patterns, and (1) the result type is not
a Seq, (2) the number of consecutive product conselectors matches the number
of arguments.
|