| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| | |
|
| | |
|
|/
|
|
|
| |
Methods like + can have multiple parameters. In that case
+= also takes multiple parameters.
|
| |
|
|
|
|
|
|
|
|
|
| |
As the comment in the code says:
"In general, a bridge is needed when the signature of the closure method after
Erasure contains an ErasedValueType but the corresponding type in the functional
interface is not an ErasedValueType."
So we need to check if _at least one_ of the type needs to be adapted,
not if _all of them_ need to, the use of "forall" was an error.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|\
| |
| | |
Fix #522.
|
| | |
|
|/
|
|
|
| |
The test had to be slightly modified because of dotty's stricter
checking of type bounds validity, see #525 where this was discussed.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Each test needs to have its own package because pos_all will try to
compile the whole valueclasses directory at once.
The remaining tests with "extends AnyVal" in tests/pending/pos are
related to separate compilation, except for:
- t6482.scala and t7022.scala which were fixed by
https://github.com/scala/scala/pull/1468 in scalac and seem to
trigger a similar bug in FullParameterization
- strip-tvars-for-lubbasetypes.scala which was fixed by
https://github.com/scala/scala/pull/1758 in scalac
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Add -strict option to do some type checks that are encessary to ensure type soundness, but
are stricter than what Scala 2.x enforces.
The first such test is the "pattern cannot be uniquely instantiated" problem where we reject a
non-variant case subclass of a covariant superclass in a pattern match. The error is now only
issued in -struct mode, otherwise it will be a warning.
We might move more tests into the same category. This should help the transition.
|
|
|
|
|
|
|
|
|
|
| |
Fixes two bugs needed for java-override test:
Namer was creating a MethodType instead of a JavaMethodType even though
the JavaDefined flag was set on the DefDef.
Following Scalac, Namer needs to convert Java method parameters
of type j.l.Object to s.Any.
|
|
|
|
| |
As noticed by @retronym, Any and Object are not identified when matching Scala and Java methods. I believe this is because the Java method does not have the Java flag set. @olhotak can you take a look?
|
| |
|
|
|
|
| |
See t3252 for a test case.
|
|\
| |
| | |
Fix/t3152 find member
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Without it, we get strange error messages like
found: (implicit X)Y
requred: Z
when the problem is really that Y is not a subtype of Z.
|
|\ \
| | |
| | | |
Fix/refined subtyping
|
| | |
| | |
| | |
| | |
| | | |
Need to also ensure that the singleton is stable. This makes
compound.scala pass.
|
| |/ |
|
| |
| |
| |
| |
| | |
GADTs now work again (they stopped workign when we went to the inductive satisfiability checks).
The deep for expression also works, even with some more levels added.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| | |
Plus, RefinedThis gets a second parameter, `level`. This will replace the first one in due time.
|
| |
| |
| |
| | |
Moved working tests to pos, annotated non-working ones.
|
|\|
| |
| | |
More tests
|
| |
| |
| |
| | |
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.
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| | |
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.
|
|\ \
| | |
| | | |
Fix/java varargs
|
| |/
| |
| |
| |
| | |
Arguments of the form (xs: _*) which are passed to
Java methods need to be converted to arrays, not sequences.
|
|/ |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The previous scheme did not propagate bounds correctly. More generally,
given a comparison
T { X <: A } <: U { X <: B }
it would errenously decompose this to
T <: U, A <: B
But we really need to check whether the total constraint for X in T { X <: A }
subsumes the total constraint for X in T { X <: B }
The new scheme propagates only if the binding in the lower type is an alias.
E.g.
T { X = A } <: Y { X <: B }
decomposes to
T { A = A } <: U, A <: B
The change uncovered another bug, where in the slow path we too a member relative to a refined type;
We need to "narrow" the type to a RefinedThis instead. (See use of "narrow" in TypeComparer).
That change uncovered a third bug concerning the underlying type of a RefinedThis. The last bug was fixed in a previous commit (84f32cd814f2e07725b6ad1f6bff23d4ee38c397).
Two tests (1048, 1843) which were pos tests for scalac but failed compling in dotc have
changed their status and location. They typecheck now, but fail later. They have been
moved to pending.
There's a lot of diagnostic code in TypeComparer to figure out the various problems. I left it in
to be able to come back to the commit in case there are more problems. The checks and diagnostics
will be removed in a subsequent commit.
|
|
|
|
|
|
|
| |
One test (t2613) required lifting a hard recursion limit in findMember
(used for debug only, will be removed in the future). The same test
also requires -Yno-deep-subtypes to be reset, so it's in pos_special
instead of pos.
|
|
|
|
|
| |
Need to account for the possibility that function
arguments are wrapped in braces.
|
|
|
|
|
| |
Nested methods cannot refer to labels in theior environment. Needs a fix in TailCalls.
Moved failing test to pending.
|