| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
1. Better formatting in TreeChecker error message
2. Re-enable printing what stack of what was checked
when an error occurred. This was disabled in Retyper
because we did not do it for the Inliner typer.
Now we distinguish on phase instead.
|
|
|
|
|
|
|
|
|
| |
... to tag inlined calls. Perform typings and transformations
of inlined calls in a context that refers to the INlined node
in its InlinedCall property.
The idea is that we can use this to issue better error
positions. This remains to be implemented.
|
|
|
|
| |
Prefer to access directly via symbol.
|
| |
|
|
|
|
|
|
|
|
| |
Drop tree node class 'Pair'. It was used only in imports, where
it can easily be replaced by Thicket.
The envisaged use for generic pairs is almost sure better modelled
by a "Pair" class in Dotty's standard library.
|
|
|
|
|
|
|
|
|
| |
Now it's annotated first, annotation second.
This is in line with AnnotatedType and in line with the principle
that tree arguments should come in the order they are written. The
reason why the order was swapped before is historical - Scala2 did it
that way.
|
|
|
|
|
|
|
| |
Tree checker typed always dropped the expected type and replaced it by a wildcard.
This meant that type checking dor -Ycheck was much weaker than it should be.
A class of GADT problems is only diagnosed once the expected type is proberly
propagated.
|
| |
|
|
|
|
|
|
|
| |
One drawback with this approach is that the type seems to propagate.
I.e. if the return type of an expression is `repeated` then the
enclosing variable will get the `repeated` type instead of getting the
expected `Seq` type
|
|
|
|
|
|
|
|
|
|
| |
There's a trap otherwise that, when in a class inheriting
from Context (and with it Reporting) a call to println will
go to this.println and therefore might not print at all, if
the current context buffers messages. I lost a lot of time
on this on several occasions when I scratched my head why
a simple debug println would not show. Better avoid this in
the future for myself and others.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, the method `Arrays.newRefArray` was one of the only 3
methods that are kept generic after erasure. This commit removes
this magic, by making it take an actual `j.l.Class[T]` as
parameter.
Moreover, the methods `newXArray` all receive an actual body,
implemented on top of Java reflection, which means that a back-end
does not *have to* special-case those methods for correctness.
It might still be required for performance, though, depending on
the back-end.
The JVM back-end is made non-optimal in this commit, precisely
because it does not specialize that method anymore. Doing so
requires modifying the fork of scalac that we use, which should
be done separately.
The JS back-end is adapted simply by doing nothing at all on any
of the newXArray methods. It will normally call the user-space
implementations which use reflection. The Scala.js optimizer will
inline and intrinsify the reflective calls, producing optimal
code, at the end of the day.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Following code should not pass Ycheck:
import java.lang.Math
val myMath: Math.type = Math
myMath.sqrt(3.0)
id(myMath)
|
|
|
|
|
| |
Mode is used from a lot of low-level code, does not just reflect Typer info.
So it makes more sense top to place it in the core package.
|
|
|
|
| |
... when definitions are missing.
|
| |
|
|
|
|
|
|
| |
Needs to go in before
https://github.com/scala/scala-jenkins-infra/pull/152
is deployed
|
|
|
|
| |
Now also provides compilation unit.
|
|
|
|
| |
Again it dies without an exception trace. Is partest eating error output?
|
|
|
|
|
|
| |
1) Have symbol sets cached per run
2) Use methods Denotation#isPrimitiveValueClass, Denotation#isNumericValueClass
instead of calling contains directly on symbol sets.
|
|
|
|
| |
... making use of method in `ctx`.
|
|
|
|
|
|
| |
withMode sets the whole mode, nit an individual bits. This was used
wrongly in several places. Make this less of a trap by renaming
withMode -> withModeBits.
|
|
|
|
|
|
|
|
| |
Dotty allows T* types only for parameter types of MethodTypes (and for
repeated arguments); all other ocurrences have to be translated to the underlying type.
TreeChecker now verifies that Ident and Select nodes never carry a repeated parameter
type.
|
|
|
|
|
|
|
|
| |
There were two architectural errors here, which confused TreeTransforms and MiniPhases
and which caused "NotDefinedHere" on transformFollowing:
1. TreeTransforms should not have idx fields, MiniPhases have them.2
2. TreeTransformers initialize arrays of MiniPhases not TreeTransforms.
|
|\
| |
| | |
Ycheck that methods defined in ClassInfo exist in tree.
|
| | |
|
| | |
|
|/
|
|
|
|
|
|
| |
LabelDefs reorders labels. As a result of reordering
label-def defined inside other label-def could be lifted outside.
LabelDefs doesn't update owner chains to represent this.
Making treeChecker aware of this.
|
|
|
|
| |
Some global roots were pointing to shared mutable state but were never used.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
The problem was due to cycles in ExtensionMethod themselves.
This reverts commit 1ce894e06a3a7b3ca64e62c1de515c2125e89343.
|
|
|
|
| |
Triggers cycles in ExtensionMethods.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
They are not lifted and they are allowed.
|
| |
|
|
|
|
|
|
|
| |
... by applying the same "ensureNoLocalRefs" logic we already apply
to blocks. This change is necessitated by Pickling - escaping variables
are not defined before being referenced. The change uncovered in turn
problems in type avoidance.
|
|
|
|
|
| |
Need to always follow TypeVariables, otherwise we will
not detect orphan parameters of uninstantiated type variables.
|
|
|
|
| |
For now check if symbol was already defined and if classes have a valid superclass.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Currently, tests fail. The failures I checked are all related to tailcalls.
Not sure whether there are others.
This is a blocker for serialization. Orphan parameters cannot be serialized.
Maybe rethink the position of tailcalls? It looks to me that the repeated trouble it gives us is
more than the effort required to put an efficient tailcall recognition after pattern matching in place.
But I might be wrong.
|
|
|
|
|
|
| |
Previously, stackoverflows led to infinite loops because the catch
immediately threw another stack overflow. Anyway, one should never
catch Throwable.
|
|
|
|
|
|
|
|
| |
A lot of cases were missing before and caused failures
in the newly added test in TreeChecker#typedThis.
Now we assure that all this references appear inside
the referenced class.
|
| |
|
| |
|