| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Ported tailcall phase from scalac with such changes:
- all transformation is done in the phase itself
(previously half of the work was done in backend)
- it is now able to run before uncurry
- it is now a treeTransform
- renamed to tailrec to make it more obvious that
this phase transforms only recursive calls.
For now this is a single phase which speculatively
transforms DefDefs.
Speculation can be potentially removed by
splitting into 2 phases:
one detecting which methods should be transformed
second performing transformation.
But, as transformation requires as same amount of work
as detection, I believe it will be simpler to maintain
it as a single phase.
Conflicts:
tests/pos/typers.scala
|
| |
|
|
|
|
|
|
|
|
| |
This shouldn't require any changes to backend,
as all type parameters will be erased in erasure
Conflicts:
src/dotty/tools/dotc/core/Symbols.scala
|
|
|
|
|
|
| |
Helper method that tests weather this particular
SymDenotation cant have overrides: eg if it's defined in module class,
if it is inner method, if it is method of anonymous class, etc.
|
|\
| |
| | |
Fixing annotations
|
| |
| |
| |
| | |
Instead of by-hand testing of modifier type.
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
Two fixes:
1) Annotation#symbol now returns the correct annotations for classes as well as traits.
2) Typer copies annotations from Modifiers to Symbols
|
|\ \
| | |
| | | |
Fix/double bindings
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
In TypeAssigner#ensureAccible we sometimes pick an inherited public
member as the denotation of a NamedType instead of an inaccessible
private one. The problem is that both are denotations for the same type,
which caused a noDoubleBindings assert failure. We now solve this problem
by creating a "shadowed" named type to hold the inherited member.
The shadowed named type is distinguished by its name, which reads
(inherited)originalName
In the future, we should make this more robust by using a general
tagging scheme to create shadowed names.
Another fix is about import symbols. They are now referenced with
NonMemberTermRefs. With this fix, the test suite passes with no
double def violations.
|
| | |
| | |
| | |
| | |
| | | |
Conflicts:
src/dotty/tools/dotc/transform/Splitter.scala
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
A double binding is if a named type gets assigned two denotations in the same period. This is
a side-effect and also a race condition, so it's very bad. I am trying to eliminate all causes of this. But one cause which will likely remain are double defitions in a prgram, if a user writes
class C {
val x: Int
val x: Int
}
Then it's really hard to avoid setting two meanings of C.this.x! That's why the testing
against double bindings is enabled by a -YnoDoubleBindings option. The understanding is that
-YnoDoubleBindings should be set only if there are no double def errors anticipated. Otherwise
the program might fail with an assertion error before the double def error is reported.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
A self name may no longer have the same name as a parameterless
class member (or param accessor). The restriction makes sense because
otherwise scoping is confusing. It's needed because otherwise we get
TermRefs that have the same name and prefix but denote different things.
Moved some code which exercises this from pos/typers to neg/typers
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The main problem with TermRef handling was that signatures were not always tracked correctly.
New invariant: A TermRef that points to a symbol is always a TermRefWithSig, and the signature
is the one of the corresponding member.
We achieve this by sometimes generating a new TermRefWithSig if a TermRef gets a denotation.
One possible simplification would be to always store a signature in a TermRef.
There's still a problem in TermRefWithSig#newLikeThis, which currently works only if the previously stored
denotation references a symbol. We will need to generalize JointRefDenotation to contain multiple symbols for
a complete fix.
|
| | |
| | |
| | |
| | | |
Retyping should not create new symbols and that includes local dummys.
|
| | |
| | |
| | |
| | | |
... to check whether tree types make sense. Still produces errors when enabled.
|
| | |
| | |
| | |
| | |
| | | |
Used to print <none> for denotations with a symbol,
now prints "some I" where I is the denotation's info.Reworked phases.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Implemented splitting operations
As a side effect, this contains a test ruling out structural term member dispatch.
Tests 0586 and 0625 which used structural dispatch got moved to neg.
|
|/ /
| |
| |
| |
| |
| | |
Cannot discard a symbol simply because the other side's type is weaker.
If in (A | B)#m A and B resolve to different symbols `m`, the resulting denotation
cannot have either `m` as symbol; it must be NoSymbol instead.
|
|\ \
| | |
| | | |
Install method for SymDenotations
|
| | |
| | |
| | |
| | |
| | |
| | | |
Add a new method to install a SymDenotation after a specific
phase has run. The new denotation replaces the current denotation
of the symbol starting with the period after the given phase.
|
|\ \ \
| |_|/
|/| | |
Bridge generation in erasure implemented.
|
| | |
| | |
| | |
| | |
| | |
| | | |
Relies on meaning of "override" to see which bridges are required.
Doesn't take in account value classes for now
Uses 'adapt' used by erasure for converting arguments and return value.
|
|\ \ \
| |_|/
|/| | |
Reduce verbosity of logs.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
We are already over limit on output size imposed by travis that is shown
in webpage, if we'll continue to add tests will be soon over limit even
to run builds.
This commit disables printing of classpath, and removes printlns in
several places.
In order for ShowClassTests to print info as is was printing
previously, please set "test.ShowClassTests.verbose" property.
|
|\ \ \
| | | |
| | | | |
Error reporting improvements
|
| | | | |
|
| | | | |
|
| | | |
| | | |
| | | |
| | | |
| | | | |
Conflicts:
src/dotty/tools/dotc/typer/TypeAssigner.scala
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Diagnostic and might be nonsensical
Conflicts:
src/dotty/tools/dotc/typer/Checking.scala
src/dotty/tools/dotc/typer/TypeAssigner.scala
|
| | | | |
|
| | | | |
|
| | | |
| | | |
| | | |
| | | | |
decouple Diagnostic from ContextBase
|
| | |/
| |/|
| | |
| | | |
remove all isSensical/SuppressedMessage logic from InfoString
|
|\ \ \
| |_|/
|/| | |
Topic/loggable transforms
|
| | |
| | |
| | |
| | | |
... to verify whether they work correctly.
|
| |/
| |
| |
| | |
using traceIndented in the transform method.
|
|\ \
| | |
| | | |
Documentation and a bit of cleanup.
|
| |/
| |
| |
| |
| |
| | |
Added documentation for non-trivial logic in Contexts, Phases and
TreeTransforms.
Removed redundant vars and casts
|
|\ \
| |/
|/| |
TypeTestCasts fixes and InterceptedMethods transformer
|
| |
| |
| |
| |
| |
| |
| | |
Replace member references for:
methods inside Any( == and !=)
## on primitives
.getClass on primitives
|
|/
|
|
|
|
|
|
|
| |
def p() = println().isInstanceOf[Long & Int]
was rewritten to
val ev$1: [T0]Boolean(x.isInstanceOf) = println().isInstanceOf
println().$isInstanceOf[Long & Int].&&(println().$isInstanceOf[Long & Int])
|
|\
| |
| | |
Fix build: Fix error in lazy-vals.
|
|/
|
|
| |
Wrong helper method was used.
|
|\
| |
| | |
Transform/erasure
|
| |
| |
| |
| |
| | |
Refactored re-typing logic from erasure into seperate ReTyper class. Another candidate
subclass of ReTyper is a future TreeChecker.
|
| |
| |
| |
| |
| |
| |
| | |
withPhase operations in contexts are now memoized.
Conflicts:
src/dotty/tools/dotc/core/Contexts.scala
|
| |
| |
| |
| |
| |
| | |
clear is wrong. E.g. clearTyperState does not clear the typerstate at all. It installs a
fresh (i.e. cloned) copy of the previous one. clearScope is also wrong; it installs a new
scope, does not clear the current one.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The transformation framework needed to be changed so that contexts passed to
transformations have correct owner chains. These owner chins are demanded by
the Splitter phase.
Note: I eliminated the contexts array in TransformInfo because it interfered
with the owner computations. Generally, caching contexts with some phase is best
done in Contexts, because withPhase is also used heavily in othre code, not just in
Transformers.
New phase: Splitter
When it is complete, it will make sure that every term Ident and Select node
carries a symbol. Right now, all it does is coverting self reference idents to
"this"-nodes.
|