| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|/
|
|
|
| |
Only the parameters in the first parameter list of a case class should get
the `CaseAccessor` flag. Fixes #2020.
|
|\
| |
| | |
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.
|
|\ \
| |/
|/| |
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.
|
|/
|
|
|
|
|
|
| |
val definitions and for expressions both distinguish whether
something is a pattern or a variable binding. They no do it
the same way: `ident` or an `ident: type` is a variable binding,
everything else is a pattern. Previously, capitalized idents
were considered as bindings in valdefs but as pattern in fors.
|
|\
| |
| | |
Fix #1501 - Check trait inheritance condition
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The leading class should be the superclass of the first trait
(which is not always Object).
We could think of a more refined condition, (i.e. taking the least
common superclass of all extended traits), but I think it's not worth
it, as one can always spell out the right superclass manually.
|
| | |
|
|\ \
| | |
| | | |
Better positions for infix operations
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Preserving the position of infix operators is useful for IDEs'
type-at-point. We also preserve the position of the untyped lhs of
right-associative operators, this is useful both for IDEs and for error
messages, before:
4 |val x: List[Int] = "foo" :: List(1)
| ^
| found: String($1$)
| required: Int
|
After:
scala> val x: List[Int] = "foo" :: List(1)
-- [E007] Type Mismatch Error: <console> ---------------------------------------
4 |val x: List[Int] = "foo" :: List(1)
| ^^^^^
| found: String($1$)
| required: Int
|
Note: It would be even nicer if we displayed "String" instead of
"String($1$)" since $1$ is synthetic, this commit does not address this.
|
| |/
| |
| |
| |
| |
| |
| |
| | |
This has two advantages:
- We can distinguish BackquotedIdent from Ident, allowing the user to
use a defined "type `&`", see testcase.
- We get better positions for the operators. This is useful in IDEs, for
example to get the type at point.
|
|\ \
| | |
| | | |
Positioned#initialPos: Union the position of every children
|
| |/
| |
| |
| |
| |
| | |
Previously we missed some children, one consequence of this is that the
position of the typed tree corresponding to the lambda "z => 1" did not
contain the position of "z".
|
|/ |
|
|
|
|
|
| |
If a tree has type error, subtrees may not have an assigned type.
Therefore we should avoid transforming such trees.
|
|\
| |
| | |
Implement structural type member access
|
| |
| |
| |
| |
| |
| | |
A previous type comparison was wrong because it did not map
refined-this types. I believe it was also redundant, so the easiest
fix is to drop it.
|
| |
| |
| |
| | |
New scheme for implementing structural type member access.
|
| | |
|
|/ |
|
|
|
|
|
| |
Need to be careful not to read a classfile before a compilation unit
defining the annotation is entered.
|
|
|
|
| |
An operation was performed quadratically before.
|
|\
| |
| | |
Add implicit function types
|
| | |
|
| | |
|
| |
| |
| |
| |
| | |
The Ref copier copies Idents and Selects, changing the name
of either.
|
| |
| |
| |
| |
| | |
When the expected type is an implicit function, create an
implicit closure to match it.
|
| |
| |
| |
| |
| | |
Implicit modifiers were quite irregular compared
to the other ones. This commit does a cleanup.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Also: show implicit function types correctly.
Also: refine applications of implicit funcitons
- don't do it for closure trees
- don't do it after typer.
|
| | |
|
|\ \
| | |
| | | |
Fix #1802: Make sure errors are not swept under the carpet
|
| |/
| |
| |
| |
| |
| |
| |
| |
| | |
Typer#ensureReported's comment outlines an example where errors
could go unreported, resulting in error trees after typer without
any reported error messages. This commit makes sure that at least
one error is reported if a tree node has an error type.
Fixes #1802.
|
|\ \
| |/
|/| |
Fix #1797: Allow case class params with names _1, _2, ...
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This was not possible before because it clashed with the automatically
generated name of the accessor. We now allow it, by simply taking the
parameter(accessor) itself as the case class accessor if it already has
that name. But you still cannot write
case class C(_2: Int, _1: String)
nor should you be able to do this.
|
|\ \
| |/
|/| |
Fix #1790: Change by-name pattern matching.
|
| |
| |
| |
| | |
This implements the rules laid down in #1805.
|
|/
|
|
|
| |
Drop explicit types for local implicit vals of type Context
and Position. Exercises the functionality and shortens the code.
|
|\
| |
| | |
Fix #1765: Context bounds and denotation handling
|
| |
| |
| |
| |
| |
| | |
With the change to the representation of higher-kinded type definitions,
context bounds could be hidden in the body of a type lambda. Need to
compensate for that.
|
|/ |
|
|
|
|
|
| |
Honor the new scheme where any explicit import of a
root import will disable the root import.
|
| |
|
|
|
|
|
|
|
|
|
| |
This manifested itself as a pickling difference in tasty_tools
Note that there are probably more issues in this method, in particular
the old type is reused when `qualifier.tpe eq tree.qualifier.tpe` even
if the `name` is different. But I'm only trying to get the tests to pass
for now.
|
|
|
|
| |
This manifested itself as a pickling difference in tasty_tools
|
|
|