| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
|\ \
| | |
| | | |
Closes #579 Implement mini-phase for classOf[T]
|
| | | |
|
|\ \ \
| | | |
| | | | |
Fix/#646 array addition
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Previously `viewExists(X, Y)` failed if there were ambiguous
implicit conversions from X to Y. This is too fragile, as
demonstrated by test case run/array-addition.scala. Here,
the `genericArrayOps` implicit was not inserted because its
result type `Array[?T]` was deemed to be incompatible with
`? { +: : ? }`. It was incompatible because there were multiple
implicits that added :+ to arrays of various element types.
But once `genericArrayOps` gets applied, the type parameter
`?T` of the array result is fixed, and the ambuity goes away.
The scenario shows that we should not test for ambiguous implicits
in viewExists. Such a test is fragile because it depends on the
progress of type inference when the test is made. It's preferable
to just test for any implicit conversion to exist and to check
for ambiguities later, when the implicit conversion is actually
applied. This has also the potential of speeding up implicit search
in situations where `viewExists` is called often (e.g. when coupled
with overloading resolution).
|
|\ \ \ \
| |/ / /
|/| | | |
Fix/#652 erase constructors
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Previously this was only done in secondary constructors; need
to do it in primary constructor as well to avoid "reference to
this before super" problems.
|
| | | |
| | | |
| | | |
| | | |
| | | | |
Proxy references in constructors can't be left as fields because
they can happen before the supercall.
|
| |/ /
| | |
| | |
| | |
| | | |
Map references to outer accessors in secondary constructors to outer parameters. This
was the second source of "reference to this before super call" errors.
|
|\ \ \
| |_|/
|/| | |
Fix checking whether types are instantiable.
|
| | |
| | |
| | |
| | |
| | | |
The logic for checking aginst the self type was wrong, as demonstrated
by pos/checkInstantiable.scala.
|
|\ \ \
| |_|/
|/| | |
Fix/#655 eta expansion
|
| | |
| | |
| | |
| | | |
Failure to do a widen caused by-name parameters to go undetected.
|
|\ \ \
| |/ /
|/| | |
Fix sequence matching.
|
| | |
| | |
| | |
| | | |
Was also fixed in this PR.
|
| | |
| | |
| | |
| | |
| | | |
Call drop method directly if class derives from sequence.
I do not understand how callRuntime works in scalac. Calling this method requires implicit search.
|
| | | |
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Previously, the expected result type of a FunProto type was ignored and taken into
account only in case of ambiguities. arrayclone-new.scala shows that this is not enough.
In a case like
val x: Array[Byte] = Array(1, 2)
we typed 1, 2 to be Int, so overloading resulution would give the Array.apply of
type (Int, Int*)Array[Int]. But that's a dead end, since Array[Int] is not a subtype
of Array[Byte].
This commit proposes the following modified rule for overloading resulution:
A method alternative is applicable if ... (as before), and if its result type
is copmpatible with the expected type of the method application.
The commit does not pre-select alternatives based on comparing with the expected
result type. I tried that but it slowed down typechecking by a factor of at least 4.
Instead, we proceed as usual, ignoring the result type except in case of
ambiguities, but check whether the result of overloading resolution has a
compatible result type. If that's not the case, we filter all alternatives
for result type compatibility and try again.
|
|\ \
| | |
| | | |
Fix #643 - Scala2 unpickling now sets NoInits flag for interfaces.
|
| |/
| |
| |
| |
| |
| |
| | |
Refinement classes and their members could give spurious stale symbol errors if the
symbol is loaded in a different run than the classfile containing it. The problem
is that refinement classes do not form part of the scope of their owners. The fix
assumes that refinement classes are always "stillValid".
|
|\ \
| |/
|/| |
Enable tests that pass, move macro tests to disabled.
|
| | |
|
| | |
|
|/
|
|
|
| |
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.
|
| |/ |
|