| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
| |
This required a major change in the way positions are handled, as the
previous scheme did not allow to read the positions of arbitrary subtrees
selectively.
Fortunately, it's altogether a major simplification.
Also, this fixed a bug in the previous scheme, where positions were
generated before compactification, resulting in addresses being wrong.
|
|
|
|
|
| |
Inline trees can now be read form TASTY. However, positions are not set
correctly. This remains to be implemented.
|
|
|
|
|
| |
- represent directly as a list
- can replace separate inlineCount
|
| |
|
|
|
|
|
| |
Dottydoc needs the unexpanded trees so that it can have access to the
attached docstring
|
|
|
|
|
|
|
|
|
| |
Avoid bindings such as
type T = T'
val x: x'.type = x'
Required some refactorings in Inliner.
|
|
|
|
| |
Inline conditionals with constant conditions
|
|
|
|
|
| |
Error messages now print the inlined positions as well
as the position of the inlined call, recursively.
|
| |
|
|
|
|
|
|
|
|
|
| |
... 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.
|
|
|
|
| |
To do this, factor out Key from Attachment into a new type, Property.Key.
|
|
|
|
|
| |
To be done: outer accessors
To be done: error positions
|
|
|
|
|
| |
- DRY
- Refactor out special path operations
|
|
|
|
|
| |
That way it can be accessed by other parts which deal with
error messages.
|
|
|
|
|
| |
The typed variant is no longer needed. This means modifiers can safely be
ignored in typed trees if we so choose.
|
|
|
|
|
|
| |
Backend does not need them after all, can just use nulls there.
So the functionality is only used for printing, and it makes
sense to move everything there.
|
|
|
|
| |
Prefer to access directly via symbol.
|
| |
|
| |
|
|
|
|
| |
Thicket has a vararg constructor, so this syntax is redundant.
|
|
|
|
|
|
| |
Roll its functionality into Select. Since we can always
tell whether a tree is a type or term there is no expressiveness
gained by having a separate tree node.
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
| |
That way, we can check functions for the ordering requirement as well.
We only have to remember that the last parameter of a wildcard function
does not precede its body (because the parameter is in fact part of the body).
|
|
|
|
| |
Arrange its sub-elements so that they appear strictly left to right.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Check that children of a node have non-overlapping positions and that positions
of successive children are monotonically increasing.
This holds currently except for 3 exceptions:
- Trees coming from Java as the Java parser also does desugarings which copy trees.
- Functions coming from wildcard expressions
- Interpolated strings
We'll see whether we can do something about the latter two.
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In particular:
- get rid of envelope, it's too complicated and hides too many errors
- check that everywhere in parsed trees the position range of a parent
node contains the position ranges of its children.
- check that all non-empty trees coming from parser have positions.
The commit contains lots of fixes to make these checks pass.
In particular, it changes the scheme how definitions are positioned.
Previously the position of a definition was the token range of the
name defined by it. That does obviously not work with the parent/children
invariant. Now, the position is the whole definition range, with the
point at the defined name (care is taken to not count backticks).
Namer is changed to still use the token range of defined name as the
position of the symbol.
|
|
|
|
|
| |
Code inspection revealed that it did the wrong thing for annotated trees,
looking in the annotation instead of in the argument.
|
|\
| |
| | |
Clean up config.Printers imports
|
| |
| |
| |
| | |
And remove the not used Printer#echo
|
| |
| |
| |
| |
| | |
Add comment what it is supposed to achieve and change the implementation
to follow the comment.
|
| |
| |
| |
| |
| |
| |
| |
| | |
Wehn compiling dotty repeatedly using dotc.Bench, we got a stale symbol
error involving an outer field of a Scala class. These can always be assumed
to be current, as we would not think to recompile Scala2 classes mixed
with dotty classes in the same session (we'd need two concurrent
compilers for that).
|
| |
| |
| |
| |
| |
| | |
Need to do time travel to find out whether members
were created as static symbols. After LambdaLift
and Flatten most symbols are static anyway.
|
| |
| |
| |
| |
| | |
1. There may be calls to super on non-this.
2. there may be calls to in-dirrect super-traits.
|
| | |
|
| |
| |
| |
| |
| |
| | |
`apply` nodes should not be inserted in the result parts
of a block, if-then-else, match, or try. Instead they should
be added to the surrounding statement.
|
|\ \
| | |
| | | |
Fix #1457: Three incompatbilities with scalac
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Three goals:
1. Fix crasher in compileStdLib by saving and restoring
foundUnderScala2 analogous to iportedFromRoot.
2. Make behavior the same as scalac under Scala2 mode -
ListBuffer behaved differently before.
3. Make findRef faster by making it tail-recursive
as long as nothing was found.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Scala2 does not conform to spec Section 2, where it says:
Bindings of different kinds have a precedence defined on them:
1. Definitions and declarations that are local, inherited, or made available by a package clause and also defined in the same compilation unit as the reference, have highest precedence.
2. Explicit imports have next highest precedence.
3. Wildcard imports have next highest precedence.
4. Definitions made available by a package clause, but not also defined in the same compilation unit as the reference, have lowest precedence.
In fact Scala 2, merges (1) and (4) into highest precedence.
This commit simulates the Scala2 behavior under -language:Scala2, but gives a migration
warning. For the naming-resolution test case we get:
dotc *.scala -language:Scala2 -migration
callsite.scala:9: migration warning: Name resolution will change.
currently selected : naming.resolution.Files
in the future, without -language:Scala2: java.nio.file.Files'
where Files is a type in package object package which is an alias of java.util.stream.Stream[java.nio.file.Path]
Files' is a class in package file
def gimmeFiles: Files = Files.list(Paths.get("."))
^
one warning found
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Two of these are unavoidable. I moved the tests to diabled/not-representable
and added in each case a comment to the main scala file detailing why there
is a deviation.
The last one (import-rewrite) is fixed.
|
|\ \ \
| | | |
| | | | |
Fix #1513: misaligned by name type parameter type bounds
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This commit removes a problematic duplicated `checkBounds` call on `TypeApply`.
To verify correctness of this change on has to check that `normalizeTree` used only once [1],
and the function using `normalizeTree` already takes care of calling `checkBounds`.
[1]: https://github.com/lampepfl/dotty/blob/0e8f05d88bfef95fac59f522fd9d06792126bd11/src/dotty/tools/dotc/transform/PostTyper.scala#L205
|
| | | | |
|
|\ \ \ \
| | | | |
| | | | | |
Fix #1510: Fix error message when abstract member not implemented.
|
| |/ / / |
|
|\ \ \ \
| |_|_|/
|/| | | |
Fixes for scala.Dynamic
|
| | | | |
|
| | | | |
|
| | | | |
|