| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| | |
Implement inline
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| | |
We got unbound symbols before because
a TreeTypeMap would copy a tree of an inline
DefDef but would not adapt the inline body
stored in the @inline annotation of the DefDef
to point to the updated tree.
|
| |
| |
| |
| |
| |
| | |
Add inline function parameters. The previous concept
of inlineable closure is adapted to coincide with
an inline function parameter.
|
| |
| |
| |
| |
| |
| |
| |
| | |
Pure expressions with function types now are considered
conforming. Necessitated a change in TreeInfo to accept
closures as pure expressions.
Test case in inlineForeach
|
| |
| |
| |
| |
| | |
The body might still refer to an inline closure argument without
fully applying it. In that case the binding may not be dropped.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
An implicit method might be unpickled in one run and the implicit
body might be selected first in a subsequent run. In that case
the inlined code was read with the original context, but
that context needs to run at the current period. This resulted
in denotation out of date errors in bringForward.
Another problem with this design was space leaks: An context might
survive multiple runs as part of an ImplicitInfo of an unpickled
method.
The new design avoids both problems. Implicit contexts are always
up to date and leaks are avoided.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
- allow inline as an alternative to final for vals
(final is retained for backwards compatibility for now)
- allow inline for parameters
- check that rhs of inline value has a constant type
- check that arguments to inline value parameters have constant type
- check that inline members are not deferred
- make inline members effectively final
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
Accessors were multiply generated under separate compilation.
To fix this, the resident body of an inlined function is now
the same as the inlined body. Both use accessors where necessary.
Previously, only the inlined body used accessors.
|
| |
| |
| |
| |
| |
| |
| | |
`inline` is now a modifier keyword. To keep disruption tolerable,
we still allow `@inline` as an annotation as well. Other uses of
`inline` are supported only under `-language:Scala2` and are rewritten
to identifiers in backticks.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Drop @dotty.annotation.inline. This will inline all
@inline marked methods in Scala for which a body is known
(i.e. that are either compiled in the same run or have Tasty
trees available).
Option -Yno-inline suppresses inlining. This is needed for
the moment because some @inline methods access private members
or members that are otherwise inaccessible at the call-site.
Also fixes some problems in Inliner
- make sure type arguments to inline calls re fully defined
- don't forget recursive calls in typeMap
- don't forget positions in treeMap
- drop dead code dealing with outer.
|
| |
| |
| |
| |
| | |
This test works, but closures are not currently inlined.
That's a still to do.
|
| | |
|
| | |
|
| |
| |
| |
| | |
Also, do some refactorings and fix some bugs in Inliner.
|
| |
| |
| |
| | |
Same test with separate compilation is in inlinePower
|
| | |
|
| | |
|
| |
| |
| |
| |
| | |
Inline trees can now be read form TASTY. However, positions are not set
correctly. This remains to be implemented.
|
| |
| |
| |
| |
| | |
pos/power inlines with alomst no extraneous boilerplate.
neg/power gives an error that maximal numbers of inlines was exceeded.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
... 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 be done: outer accessors
To be done: error positions
|
|\ \
| |/
|/| |
[WIP] fix encoding issues
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
rename test/pos/valueclasses to pos_valueclasses
tests/pos/valueclasses generates a valueclasses.flags
file in /tests/partest-generated/pos that conflicts
with the valueClasses.flags file that
tests/neg/valueClasses.scala tries to create
|
| |
| |
| |
| |
| |
| | |
`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
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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
|
| | | | |
|
|\ \ \ \
| | | | |
| | | | | |
Fixes for scala.Dynamic
|
| | | | | |
|
| | | | | |
|
| | | | | |
|
| | |_|/
| |/| | |
|
| | | | |
|
| | | | |
|
| |/ /
|/| | |
|
| | | |
|
| | | |
|
| | | |
|
|\ \ \
| | | |
| | | | |
Fix #1335: Generate null checks for extractors
|
| |/ / |
|