| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| | |
Expand SAM closures to anonymous classes if needed
|
| |
| |
| |
| |
| |
| |
| | |
Also included are
- Closures implementing classes that inherit from a class other than Object
- Closures that implement traits which run initialization code.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Like all other variables, pattern-bound vars need a fully defined type. I was
thinking originally that demanding a fully defined selector type is sufficient
to ensure this, but that's not true: An outer pattern might call a polymorphic
unapply and its type variables need not be fully instantiated.
With the fix, the minimized test case from ExpandSAMs works.
|
| |
| |
| |
| | |
The phase replaces SAM closures with anonymous classes when necessary.
|
|\ \
| | |
| | | |
Fix of #503
|
| | |
| | |
| | |
| | |
| | | |
Added test for previous PR on super accessors.
Updated test for #503 to check both inner classes and inner traits.
|
| | |
| | |
| | |
| | | |
Previously, we considered only methods. #503 shows that this is wrong.
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This avoids getting a runtime error when calling a Java-defined method
whose signature contains value classes. It happened because we erased
the value classes in this signature even though it comes from a
classfile.
Amusingly, this problem also exists in scalac:
<https://issues.scala-lang.org/browse/SI-9298>
|
|\ \
| | |
| | | |
Expand private members if necessary
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
A late miniphase which resets private flag of all
members that are not accessed from within same class.
Replaces logic in RefChecks. Doing this late has two
advantages
- we can use name expansion, because references are
symbolic, so the names of symbols and references
to them do not need to correspond anymore.
- we can automatically correct for symbols moved in earlier
phases (e.g. lifted out by LambdaLift).
|
|\ \ \
| | | |
| | | | |
Fix #522.
|
| | | | |
|
| | | |
| | | |
| | | |
| | | |
| | | | |
We were missing a substitution in full parameterization. Embarraingly, this
made even the example in the doc comment of `fullyParameterizedDef` fail.
|
|/ / /
| | |
| | |
| | |
| | | |
The test had to be slightly modified because of dotty's stricter
checking of type bounds validity, see #525 where this was discussed.
|
| |/
|/|
| |
| |
| |
| |
| |
| | |
Lower bounds need to be instantiated just like upper bounds.
F-bounded polymorphism (which only applies too upper bounds)
is one reason for instantiating arguments, but parameters
referring to other parameters is another one. An the latter
applies to lower bounds as well.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| |
| |
| |
| |
| | |
Each test needs to have its own package because pos_all will try to
compile the whole valueclasses directory at once.
|
|/
|
|
| |
This fixes the issues reported in SI-5866 and SI-8097
|
|\
| |
| | |
Implement/i499
|
| | |
|
| | |
|
| | |
|
|\ \
| | |
| | | |
Refactor/super accessors
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Not sure why we need to do this, and in any case it's not sure
what constitutes a pattern. There are certainly some parts of
patterns (e.g. prefixes of unapplies, or their implicit arguments)
that should be transformed under SuperAccessors, so the previous
condition was too coarse.
We include the test case that motivated the restriction. It looks like
it works now.
|
|\ \ \
| |_|/
|/| | |
Save TASTY in attribute of classfiles.
|
| |/
| |
| |
| |
| | |
Classfile parser now reads TASTY attributes or annotations and
unpickles them in order to allow for separate compilation.
|
| | |
|
|/ |
|
|
|
|
|
| |
Idents of lifted symbols become class members, need to carry the right
reference with the right prefix as type.
|
|
|
|
|
|
|
| |
Documentation around markFree and narrowLiftedOwner was added.
i480 was minimzed and dependencies on dotc were removed. (+1 squashed commit)
Squashed commits:
[1a84054] Test cases for #480
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|\
| |
| | |
Fix isNullableClass to also work after Erasure
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Incidentally this means that:
val d = null.asInstanceOf[Double]
is now correctly transformed to:
val d = scala.Double.unbox(null)
Previously it was translated to:
val d = null: Double
Which is wrong and fails in the backend.
|
|\ \
| | |
| | | |
New phase: trait constructors
|
| |/ |
|
|/
|
|
| |
enclosingMethod should not crash on NoDenotation.
|
|
|
|
|
|
|
|
| |
Move pickling tests into separate top-level test directory.
That way they are not needlessly pos-tested before.
Also, disable core tests for now - after rebasing we get a stale symbol error.
Need to investigate that.
|
|
|
|
|
|
|
|
|
| |
Shadowed names in types need to be pickled and treated on
unpickling.
We choose to make Shadowed a separate TastyName class, to avoid
the ad-hoc name-mangling in current dotc. When names are redone
Shadowed will also become a special class in the compiler proper.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Out-of scope references are evil but do arise. Dotc currently produces them
in two cases (t1957.scala and Typer.scala) because it does not correctly
hygenize dependent methods used as closurs. I beleive scalac wil generate them
in more instances.
The changes can produce dependent method types used in closures. Essentially the
problem was that the depndency was not recognized in Typers when the closure
was first created, because it badly interfered with type inference. But when unpickling
the same closure the dependency is recognized. It's too late to fail now, we better
deal with this gracefully. That's why there is now a mode bit "AllowDependentFunctions"
which should be turned on only for unpickling, which reconstitutes dependent functions
as closures without complaining.
|
|
|
|
| |
Both some long overdue pos tests and more pickleOK tests
|
| |
|
|
|
|
|
|
|
|
|
|
| |
ElimLocals becomes a slightly less trivial transform: NormalizeFlags.
It also computes PureInterface flag, thus relieving Namer and Unpickler
from doing the same in two different ways. Besides, the computation in
Namer/TreeInfo was flawed because it did not take into account that
nested non-static classes are not allowed in an interface (only static
classes are, but these would not be members of the interface in the Scala
sense).
|
|
|
|
|
|
|
|
| |
Also: Make Pickler a plain phase; it is neither a macro transformer nor
a miniphase.
Add tests to pickleOK that are known to be stable under pickling/unpicking
by comparing tree representations via show.
|
|
|
|
|
|
|
|
| |
We have two unhygienic closures left - one in t1957.scala the other in Typer.scala.
This commit leaves some printlns that can be uncommented to get more info on these.
It would be better to fix them but I am running out of time to do so. Maybe someone
else can pick up with the info this commit allows to recover. To find out more,
go to t1957.scala and read the comment.
|
|
|
|
|
| |
We now make sure that a closure's result type does avoid
references to parameter types.
|