| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
This gives in general a supertype, that's OK for approximation.
See ee76fda for an explanation.
|
|
|
|
|
|
|
|
| |
It would be great to augment Ycheck to ensure that some trees are not
permitted, e.g. TypeTree cannot be a stat in a block or a receiver of
a call.
Currently this is `ensured` by backend by failing.
|
|\
| |
| | |
Fix #998
|
| |
| |
| |
| | |
Needed a fix in approximateUnion.
|
|\ \
| | |
| | | |
Fix #1037
|
| | |
| | |
| | |
| | | |
instead of the one after it. Fixes problem with t7475b.scala
|
| | | |
|
| | | |
|
| |/ |
|
|/
|
|
| |
Achieved by tweaking from where we get the parameter types of an eta-expansion.
|
| |
|
|
|
|
| |
This allows us to run compileStdLib without deep subtypes again.
|
|
|
|
|
| |
Checking bounds everywhere revealed a problem in compileStdLib,
which this commit fixes.
|
|
|
|
|
|
|
|
| |
Previously, bounds of a TypeDef tree were not checked. We now make
sure bounds are checked everywhere in PostTyper. The previous
partial check in Applications gets removed (it was not complete
even for TypeApplications because sometimes bounds were not yet
known when the test was performed.)
|
|
|
|
|
| |
This is important for IDEs who want to see the full tree.
The tree now gets replaced by a TypeTree in PostTyper.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When TypeVar#inst is empty but an instantiation exists in the typer
state, we should set ephemeral to true, because this instantiation will
be retracted if we throw away the current typer state.
This makes hkrange.scala pass, it compiled before but the type parameter
of `f` was inferred to be `Nothing` because of this bug, and this failed
Ycheck.
For anyone who wonders how caching bugs manifest themselves, here's what
happened in details in hkrange.scala:
1. In an ExploreTyperState we set `CC` to be `IndexedSeq` in the
constraint set
2. In that same typer state the TypeRef `CC[Int]` (it's a TypeRef
because `CC` is a type lambda) gets the denotation `IndexedSeq[Int]`,
which is correct, but the denotation is cached since `ephemeral` is
false, which is wrong.
3. Later, we retract the ExplorerTyperState, so `CC` is uninstantiated
again and unconstrained.
4. Then we do the subtyping check `CC[Int] <:< IndexedSeq[Int]`, because
the denotation of `CC[Int]` was cached, this returns true, but `CC` stays
unconstrained.
5. This means that when we instantiate `CC`, we get `Nothing`
After this fix, the TypeRef denotation is no longer cached, so when we
do `CC[Int] <:< IndexedSeq[Int]`, `CC` gets constrained as expected.
|
|\
| |
| | |
Improve migration message for Scala 2 procedures
|
| |
| |
| |
| |
| |
| | |
It's not correct to just add `=` you also need to specify the return
type to be `Unit` otherwise things may not work as expected, this is
especially important for a `main` method.
|
| |
| |
| |
| | |
This makes compileIndexedSeq pass again.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Type params should be computed before computing the whole info of
a type. Without the patch we get a cyclic reference in the compileMixed
test.
Note that compileIndexedSeq does not pass with this commit (it passed
before), this is fixed in the next commit.
|
| |
| |
| |
| |
| |
| |
| | |
Need to also look info refined types.
Need to handle case where we hit a NoCompleter again.
Fixes #974 and makes MutableSortedSetFactory in stdlib compile.
|
|/
|
|
|
|
| |
There was no reason in the first case to cache them, as their
equality is reference identity. Maybe this fixes the OOM errors
we encounter.
|
|
|
|
|
|
| |
Needs to go in before
https://github.com/scala/scala-jenkins-infra/pull/152
is deployed
|
|\
| |
| | |
Subtle changes to TypeComarer needed for Linker.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Motivation comes from Linker:
List$.canBuildFrom is implemented as
ReusableCBF.asInstanceOf[GenericCanBuildFrom[A]]
static type of field ReusableCBF here is
TypeRef(TypeRef(List$), GenericCanBuildFrom[Nothing])
but the ident ReusableCBF gets type
TypeRef(ThisType(List$), GenericCanBuildFrom[Nothing])
We already permit comparisons between static TermRefs and ThisTypes,
this change additionally allows TypeRefs to static modules to
become subtypes of ThisTypes of static modules.
|
| | |
|
| |
| |
| |
| |
| | |
Linker needs to resolve super calls
before they are rewritten in the tree.
|
| |
| |
| |
| |
| |
| | |
This prevented Dotty from bootstrapping when the file arguments were
given in a certain order because of #1017. Regardless of what we do
regarding #1017, it makes sense to use "def clone()" here.
|
|\ \
| | |
| | | |
Fixes&Changes to TASTY inspired by Linker
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | | |
Linker adds new sections. Wait for sections to be added and then compact.
|
| | |
| | |
| | |
| | | |
Needed to be able to access additional sections of TASTY.
|
| | |
| | |
| | |
| | |
| | | |
Linker needs to save some trees.
Instead of reimplementing I would rather reuse already existing methods.
|
| | | |
|
| | | |
|
| | | |
|
| |/
| |
| |
| |
| |
| | |
Makes all classes and fields on the way to TASTY section accessible.
Example of usage can be found here:
https://gist.github.com/DarkDimius/0f9dc769b0dd7a3c7365
|
|\ \
| | |
| | | |
Ycheck that scala.Array is erazed to either Object or JavaArrayType.
|
| | |
| | |
| | |
| | | |
Array is still allowed after erasure when compiling Array.scala.
|
| | | |
|
| |/
| |
| |
| | |
It should either be erased to j.l.Object or replaced by JavaArrayType.
|
|\ \
| | |
| | | |
Fix #1009: Do not forget to skolemize some types
|
| | | |
|
|\ \ \
| |/ /
|/| | |
More tests
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
In a situation like
List <: [X] -> <: GenTraversable[X]
We have to ask whether the rhs contains the instantiated lhs,
not whether it is a supertype.
|
| | | |
|