| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| | | | | | |
|
| | | | | | |
|
| |/ / / /
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Implicit and non-implicit functions are incomparable with <:<, but are
treated as equivalent with `matches`. This means implicit and non-implicit
functions of the same types override each other, but RefChecks will
give an error because their types are not subtypes.
Also contains a test for #2002.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Fix off-by-one error in forward reference checking
|
| | | | | | |
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
Avoid accidental captures of Context
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
This capture did not cause any problem since we always called
TempClassInfo#finalize with the same Context than we captured in
`addSuspension`, but it's better to be explicit about these things.
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Previously we computed the scope in `findModuleBuddy` using
`this.effectiveScope`, this means that we captured `this` which has a
self-type of `Context`, replacing it by `ctx.effectiveScope`
would be wrong since we are interested in the scope at the time
`adjustModuleCompleter` was called, not the scope at the time the
completer is called. Therefore, we have to eagerly compute
`this.effectiveScope` so that we don't capture the Context but can use
the right scope in `findModuleBuddy`.
We also move `findModuleBuddy` to a companion object to avoid accidental
captures of `this`.
This capture lead to crashes in the IDE.
|
| | | | | | | |
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
ImportInfo#toString required the ctx parameter,so it was replaced by
ImportInfo#toText.
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
getMember needs to take an implicit `Context` parameter, otherwise the
following code:
val result = ctx.atPhaseNotLaterThan(ctx.typerPhase) { implicit ctx =>
getMember(owner, innerName.toTypeName)
}
will not run getMember at the typer phase.
|
| | | | | | | |
|
| | | | | | | |
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
`lazyStats` creates a lazy tree using `readLater`, but the closure
inside `readLater` calls `mergeTypeParamsAndAliases` which until this
commit implicitly used the Context from the outer method `readTemplate`,
this lead to crashes in the Language Server.
|
| | | | | | | |
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Previously, `specificProto` was a def even though it is always called,
this is because in cece884812143c6c8090ce08c6321bd4a1d52ea6, the usages
of `specificProto` and `genericProto` were swapped. We fix this by only
defining the protos where they are used. Incidentally, this mean that
the calls to UnapplyFunProto will use the correct Context inside
`tryEither`, although in this case this shouldn't matter.
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Previously, the following code accidentally used the implicit Context
parameter of `typedApply`:
tryEither {
implicit ctx => typedOpAssign
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
The captured context was passed implicitly to dd.rhs, atGroupEnd is
always run with the same runId as the captured context so this should be okay,
but it's better to avoid using two contexts in the same expression anyway.
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
The capture context was only used to get its phase so shouldn't cause
any problem.
|
|\ \ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
Fix #1747: Improve error message for Scala/Java type mismatch
|
| | | | | | | | |
|
| | | | | | | | |
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
We used to "fill-in" with zeroes if variances were missing. I now
think that;'s too error-prone. Better define all variances explicitly.
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
Omit the `=>' if a PolyType has a MethodType as result type.
|
|\ \ \ \ \ \ \ \
| |_|_|_|_|/ / /
|/| | | | | | | |
Don't inline when errors are detected
|
| | |_|_|/ / /
| |/| | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Inlining is only well-defined if the body to inline does not
have any errors. We therefore check for errors before we
perform any transformation of trees related to inlining.
The error check is global, i.e. we stop on any error
not just on errors in the code to be inlined. This is a safe
approximation, of course.
|
|\ \ \ \ \ \ \
| |/ / / / / /
|/| | | | | | |
Fix #1990: Handle inlining where this proxies change types
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
It turns out that we simply cannot do reliable outer path
computation that fills in the right hand sides of this-proxies
from the types of these proxies. As-seen-from logic can mangle
the types of proxies enough to scramble the necessary information.
What we now do instead is simply count: We record the number
of outer accesses to an outer this in inlineable code, and do the same number
of outer accesses when computing the proxy.
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
They are sorted according to the nesting depth of the classes they
represent. This is no necessarily the same as the nesting level of
the symbols of the proxy classes. i1990a.scala shows an example where
the two differ.
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Interesting that the tests pass even if we always assume outOfContext = true.
So this raises the question why have a flag? It's just that I am not sure the
`outOfContext` behavior is correct in all cases. So I prefer to be conservative
here.
|
| | |_|_|_|/
| |/| | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
The new situation in the test was that outer of the inlined method
was `A` but it's as seen from type is a subtype `B`.
We need two fixes:
- Ignore outerSelects in TreeChecker. These are treated as having fixed symbols.
- Adapt the outer-path logic to deal with code that's moved to another context.
|
| | | | | | |
|
| | | | | | |
|
| | | | | | |
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
Remove unused flags
|
| | | | | | | |
|
| |/ / / / / |
|
|\ \ \ \ \ \
| |_|_|/ / /
|/| | | | | |
Use enum for error messages IDs.
|
| | | | | | |
|
|\ \ \ \ \ \
| |_|_|_|/ /
|/| | | | | |
Disable tests that require scala-compiler
|
| | |/ / /
| |/| | |
| | | | |
| | | | | |
This is necessary if we ever want to get rid of our dependency on scala-compiler
|
|\ \ \ \ \
| | | | | |
| | | | | | |
TreeMap/TreeAccumulator: proper context for inlined trees
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
This was already be done in TreeTraverser but should also be done in
TreeMap and TreeAccumulator for ctx.error(..., tree.pos) to not use
completely incorrect positions inside inlined trees.
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
checkNoPrivateLeaks: Use correct position for errors
|
| | |/ / / /
| |/| | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Previously we never used the `pos` argument of `checkNoPrivateLeaks` and
instead used `sym.pos`, this makes a difference for calls to
`avoidPrivateLeaks` coming from `TreeUnpickler` where we should use
`tree.pos` instead.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
We cannot assume that the untyped rhs of the bind is a `Typed` tree,
with extractors it might be an `Apply` node, and in general it might
also be a `Parens` node.
|
|/ / / / / |
|
|\ \ \ \ \
| |_|/ / /
|/| | | | |
Factor out logic for scala functions.
|
| |/ / /
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
* Add `isSyntheticFunction` checks for synthetic functions such as FuntionN
for N > 22 and ImplicitFunctionN for N >= 0.
* Add `erasedFunctionClass` to get the erased verion of synthetic functions.
* Change the semantics of `isFunctionClass` to return true if it is any kind of
FunctionN or ImplicitFunctionN.
|
| | | | |
|