| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
|
|
|
|
|
| |
If PolyTypes are to become value types we want to keep `=>` as the arrow
for consistency. `->` should be reserved for PolyTypes that do not have
side effects on instantiation.
|
|
|
|
|
|
| |
Let them inherit the same traits and push as much
functionality as possibly into the common superclass
GenericType.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For the moment, we do not know how to handle something like
1 | 2
or
x.type | y.type
correctly. So it's better to disallow these situations until we find a proper
solution.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Thanks @smarter!
|
| |
|
| |
|
| |
|
| |
|
| |
|
|\
| |
| | |
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
|