| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| | |
Fix build failure after merging #1492
|
|/
|
|
| |
The one-parameter constructor of SourceFile was removed in #1494
|
|\
| |
| | |
Implement inline
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| | |
Since we have no nice way of hashing a typed tree we use the
pretty-printed tree of the method (as it would be printed by
-Xprint:posttyper -Xprint-types) as a hacky substitute for now.
|
| | |
|
| |
| |
| |
| |
| | |
This makes "publishLocal" much faster which is extremely useful when
working on the sbt bridge.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This special case was added two years ago, quoting from
5428549a57b710b11e57aab4eee24e9b89b8b97c
"Inlined pure values are pure even if referenced from impure
prefixes (i.e. prefix need not be evaluated)"
This does not match the current semantics for inline where the prefix is
always evaluated.
|
| |
| |
| |
| |
| | |
Better comments and refactorings that move some things around
so that less modules depend on Inliner.
|
| |
| |
| |
| | |
Now that we have BodyAnnot, InlineInfo can be eliminated.
|
| | |
|
| |
| |
| |
| |
| |
| | |
Since fundamental operations such as treeCopy have to know
about inline bodies, it seems better to represent this
information directly in an annotation.
|
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When typing an untpd.TypedSplice it could be that the owner
at the time the tree is originally typed is different from the owner
at the time the tree is unwrapped. In that case the owner needs
to be changed.
Problem was noticed in Course-2002-02 after changing Closure to
be a pure expression. This means that TypedSplices containing
closures are no longer lifted out from containing closures
during eta expansion, and the owner chain got corrupted.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We got an error when we tried t opur @inline annotations
on function parameter types. It turned out that there were
lots of places where annotations on a type would break a test
in the compiler.
So we now drop annotations by default when dealiasing. We provide
dealiasKeepAnnots as an alternative that has the old behavior, i.e.
rewrap annotations after dealiasing. The only place where we found we
needed this was in the exhaustivity checker.
|
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| |
| |
| | |
Make sure that inline accessors are not added twice. We got lucky so far
because the fact that annotations are lazy meant that attachments did not
persist. But if @inline was made into a strict annotation, inline accessors were indeed
added twice.
|
| | |
|
| |
| |
| |
| |
| |
| | |
Now it's done on the symbol directly rather than its inline
annotation. This simplifies client code and keeps the implementaion how
inline infos should be assocated with inline methods open.
|
| | |
|
| |
| |
| |
| |
| |
| | |
If an argumnet to an inline method refers to a closure
that is the result of eta-expanding another inline method
inline the argument method.
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| | |
This makes existsing uses of inline mostly compile.
Todo: Verify that stdlib can be compiled.
Todo: Implement accessors for assignments to priavte variables
Todo: Figure out what to do with accesses to private types.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
After inlining we got a Ycheck error of the form:
found : `this.asInstanceOf[SelfType].C`
expected: `this.C`
The fact that it was related inlining was coincidental I think.
We fix the problem by expanding to
this.asInstanceOf[SelfType & this.type].C
instead.
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| | |
The previous check whether a method was an inlined method with a body
forced computation of the body, which led to problems when dealing with
recursive inline methods.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| |
| | |
Because of different close seqences before and after pickling
we could get spurious differences, where in one file things were
put on one line, and in the pther there was a linebreak.
|
| |
| |
| |
| |
| | |
This test works, but closures are not currently inlined.
That's a still to do.
|
| |
| |
| |
| |
| |
| |
| | |
1. Imlement typedUnapply
2. Disable implicit view searches and searches
for equality checks - these should have already
happened in the first typer run.
|
| |
| |
| |
| |
| | |
Inlined operations are: Stats.track and all variants
of Reporter.traceIndented.
|
| |
| |
| |
| | |
Print what was pickled when failing with unresoilvced symbols.
|
| |
| |
| |
| |
| |
| |
| |
| | |
1. Don't generate local aliases - we can potentially run into
avoidance problems later for such aliases
2. Scan all parts of leaf types for things that need to be
registered cor remappings.
|