| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| | |
Fix #1065 erasedLub for arrays of primitives.
|
| |
| |
| |
| |
| |
| | |
Unlike arrays of objects, that can be accessed as an array
of a super type of this object,
int[] cannot be accessed as an array of primitives.
|
|\ \
| | |
| | | |
Handle "missing args" case when expected type is a singleton type.
|
| | |
| | |
| | |
| | | |
Fixes #803.
|
|\ \ \
| | | |
| | | | |
Hide stack traces behind -Ydebug
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Instead, a new setting called -Yplain-printer is used for this.
After this commit, we can now run all tests with -Ydebug (this was not
the case before because using the plain printer breaks -Ytest-pickler)
|
| | | |
| | | |
| | | |
| | | |
| | | | |
This makes the compiler extremely slow. To store the trace, you now need
to pass -Ytrace-context-creation
|
| | | | |
|
| |/ /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
They're not very useful for end users and some tests like
tests/neg/selfreq.scala always print these exceptions which makes it
harder to read the test logs,
Also use Thread.dumpStack() instead of creating an Exception and calling
printStackTrace() on it.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
When `wildApprox` encounters a PolyParam it approximates it by its
bounds in the current constraint set, but this is incorrect if
`TypevarsMissContext` is set, we might get the bounds of another use of
this `PolyType`. This is exactly what happened in i1044.scala where the
implicit view `refArrayOps` needs to be used twice with two different
type parameters.
The fix is to approximate a PolyParam by its original bounds in its
PolyType if `TypevarsMissContext` is set.
This fix was inspired by the approach of #1054.
|
|\ \ \
| | | |
| | | | |
Force the initialization of throwMethod in Definitions
|
| |/ / |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
It seems when unpickling nsc that some module classes come
without a source module. Survive this situation rather than
crashing. i859.scala is an example.
i859 compiles with the patch, but causes a deep subtype when unpickling.
Not sure whether scalac does the same.
|
| | |
| | |
| | |
| | |
| | | |
Instead of forcing again, and causing an assertion error, back out
assuming that the result is false. Fixes first problem with #859.
|
|/ /
| |
| |
| |
| | |
It's slightly more efficient. There was no need to have
a separate cache for the lazy val.
|
| | |
|
| |
| |
| |
| |
| |
| | |
Previously, we could set compilerCallback on non-fresh contexts, but
there is no reason that this should be allowed, and this is not done
anymore in the code since the last commit.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
- Document the entry points
- It is now possible to set a custom reporter without using a custom
context
- Use `null` for optional arguments to make it easier to run the
compiler using reflection or from Java.
- DPDirectCompiler does not use a custom context anymore
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
With this commit and the previous one, partest should finally correctly
log the output of the compiler and display it at the end of its
execution if compilation failed.
Also make sure the initial Reporter in a Context is _not_ a ThrowingReporter.
Previously, the initial Reporter was always overriden in Compiler by
rootReporter so it had no effect, but this is not the case anymore, and
the negative junit tests fail with the ThrowingReporter since they throw
an exception instead of exiting with a certain number of errors.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Also CompilerTest no longer runs the compiler with the context
DottyTest#ctx. Previously, we got away with this because
Compiler#process ignored it and created a new Context, but this commit
fixes this, and it is now very important that we use a different context
for every test we compile. Since DottyTest#ctx was the only part of
DottyTest we used, CompilerTest no longer extends DottyTest to make sure
that we do not use it accidentally. If we want to use DottyTest as a
base class for tests again, we will have to remove its implicit Context
field first.
Also do not try to initialize the definitions in the context used by
partest, this is not necessary.
|
| | |
|
|/ |
|
|
|
|
|
|
|
|
| |
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.
|