| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|/ /
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| | |
As suggested by @retronym
|
| |
| |
| |
| |
| | |
Parameter accessors in traits have the ParamAccessor flag removed
in the Mixin transformSym method.
|
| |
| |
| |
| | |
Verify that the initilialization order described in #640 is correctly implemented.
|
| | |
|
| |
| |
| |
| |
| |
| | |
Add necessary logic to Mixin. Also add tests
that all parameterized traits are called with
parameters set.
|
| |
| |
| |
| |
| | |
A parent trait may not be parameterized (as in T()) if the calling class does not
directly implement that trait.
|
| | |
|
|\ \
| | |
| | | |
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".
|
|\ \
| | |
| | | |
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.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Skolemize unstable prefixes in asSeenFrom provided
- the prefix appears at least once in non-variant or contra-variant position
- we are in phase typer.
After typer, we have already established soundness, so there's no need to
do skolemization again. We can simply do the (otherwise unsound) substitution
from this-type to prefix.
|
| | |
| | |
| | |
| | |
| | | |
A term ref is stable only if its prefix is also stable. At the same time, we
drop stability requirements where they no longer make sense (e.g. in isLegalPrefix).
|
|\ \ \
| |_|/
|/| | |
Enable tests that pass, move macro tests to disabled.
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | | |
Changes were made by accident.
|
| | |
| | |
| | |
| | |
| | | |
Methods like + can have multiple parameters. In that case
+= also takes multiple parameters.
|
|\| |
| | |
| | | |
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
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Until the previous fix to Denotation-& the test here spuriously passed.
The Dotty spec is that value classes synthesize equals and hashCode only
if no concrete definitions are inherited except the ones from Any. That
was previously miscalculated.
The test has been updated to reflect the specified behavior.
|
| |
| |
| |
| | |
We are still lacking the setup to do this right for mixed Scala 2/Dotty runtime tests. So I checked into `pos` for now.
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| | |
generation"
This reverts commit cafd71af4902c76561f27a479c14e53729600bb9.
For the future refference: tests and checkfiles should be modified only after carefull thought.
Otherwise our tests will stop indicating the correct behaviour.
|
|/
|
|
| |
This reverts commit 8f90105dc4e62e78d53b385df1b2eb29f2855183.
|
| |
|
|
|
|
|
| |
See https://github.com/lampepfl/dotty/pull/624#issuecomment-107064519
for a lengthy explanation.
|
| |
|
| |
|
|
|
|
|
|
| |
class is also the top-level class"
This reverts commit 6898d2c296326779d373ef0e0b84e4451550120a.
|
|\
| |
| | |
Add a test for supercalls in traits.
|
| |
| |
| |
| | |
Also added non-unit fields and a class that directly implements two traits with the same fields.
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Also mark the forwarder as Stable otherwise we get a RefChecks error.
This fixes #608.
Note that we do less parameter forwarding than scalac. See for example D
and Y in tests/run/paramForwarding.scala which don't get their own local
fields in scalac but do in dotty.
|
| | |
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|