| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| | |
SI-7624 Fix -feature and some -Xlint warnings
|
| | |
|
|\ \
| |/
|/| |
SI-7265 javaSpecVersion, adjust isJava... tests for 2.11
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Make this and related properties public, because they
are useful.
This change ought to have been committed at 2.11 and then
backported with restrictions, rather than vice-versa.
Note that they are defined in the order, version, vendor
and name, which is the order from the underlying javadoc.
It would be a neat feature of the PR validator, as previously
imagined, to run a "pending" test and then, on success and
merge, to move it automatically to the canonical suite.
|
|\ \
| | |
| | | |
SI-7690 ghost error message fails compile [Rebase of #2763]
|
| | |
| | |
| | |
| | |
| | |
| | | |
I won't even try to explain the error reporting code, because
it would have no basis in reality. However this change appears
to fix the symptom reported.
|
|\ \ \
| | | |
| | | | |
SI-7729 Does Par-Test work? Absolutely!
|
| |/ /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Check files split into conditional blocks with partest flags
have been broken since the new diff regime.
For some reason, no one noticed.
The clever scheme to "filter the diff" instead of just filtering
the check file is abandoned as futile and unnecessary.
Fix java6 checkfile for ifdiff fix.
|
|\ \ \
| | | |
| | | | |
Making map2Conserve occupy constant stack space in spirit of SI-2411.
|
| |/ /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
I recently discovered a StackOverflowError, caused by this function:
https://gist.github.com/folone/7b2f2e2a16314ab28109
The circumstances are pretty extreme, still having a tail-recursive
function seems to be a good idea.
The function behaves the same way old function did (supported by tests),
which is not really how map2 behaves. I did not change this behavior to
not introduce any regression. I actually tried to make it behave like map2,
and it does introduce regression.
|
|\ \ \
| | | |
| | | | |
DefDef.name is now TermName again
|
| |/ /
| | |
| | |
| | |
| | | |
Now when there's no hope left for type macros, it's reasonable to provide
a more specific type for DefDef.name.
|
|\ \ \
| |/ /
|/| | |
Fix N^2 spot in erasure.
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
An expression containing nested casts would type the same tree 2^N
times where N is the number of nested casts. This was particularly
visible in Vector.scala where one can find a six-cast expression.
It's currently line "why was six afraid of seven", aka line 789.
display5((index >> 25) & 31)
.asInstanceOf[Array[AnyRef]]((index >> 20) & 31)
.asInstanceOf[Array[AnyRef]]((index >> 15) & 31)
.asInstanceOf[Array[AnyRef]]((index >> 10) & 31)
.asInstanceOf[Array[AnyRef]]((index >> 5) & 31)
.asInstanceOf[Array[AnyRef]](index & 31)
.asInstanceOf[T]
Compiling Vector.scala, before/after.
< #unique types : 10805
> #unique types : 9722
< #created tree nodes : 26716
> #created tree nodes : 25647
I found a similar bug about a year ago in 39f01d4f48. It's
interesting to consider how little defense we have against bugs
of this nature - visually non-obvious differences in tree
traversal can have spectacular impact on complexity.
|
|\ \
| |/
|/| |
Refactor the cake so SymbolTable does not depend on Global
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
ClassfileParser depends on forcing infos during typer phase.
It's not entirely clear why this is needed (git blame doesn't
help much) but I decided to preserve the logic.
Therefore, I introduced an abstract method called
`lookupMemberAtTyperPhaseIfPossible` which preserves the original
semantics but is implemented outside of ClassfileParser so the
ClassfileParser itself doesn't need to depend on typer phase and
phase mutation utilities.
I removed `loaders` override in `test/files/presentation/doc`.
I would have to update it to implement the
`lookupMemberAtTyperPhaseIfPossible` method. However, the override
doesn't seem to be doing anything useful so I just removed it.
|
|\ \ |
|
| |\ \
| | | |
| | | | |
Improve type printing (toString/debugging)
|
| | | | |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
More consistency as to how to understand aliases,
singletons, specialized symbols, subclasses. Fewer
weird special casings, like normalizing tuples
and functions during type printing, but nothing else.
I avoid "normalize" entirely now, and do not make
special cases for dealiasing, which is already well
handled when printing error messages.
Look at the change to test/files/neg/t2641.check to get
a sense of why we should resist calling normalize during
the early days of a compilation run.
Anonymous and refinement classes can be printed far more
usefully by revealing their parents, and that too is here.
Hardened toString against undesirable side effects.
Make toString final to discourage any further rogue
toString overriders. Make safeToString a little safer.
|
|\ \ \ \
| |/ / /
|/| | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Conflicts:
bincompat-backward.whitelist.conf
bincompat-forward.whitelist.conf
src/compiler/scala/reflect/reify/phases/Reshape.scala
src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala
src/compiler/scala/tools/nsc/transform/Mixin.scala
src/compiler/scala/tools/nsc/typechecker/RefChecks.scala
src/compiler/scala/tools/nsc/typechecker/Typers.scala
src/library/scala/concurrent/impl/Promise.scala
src/reflect/scala/reflect/internal/StdAttachments.scala
test/files/neg/macro-override-macro-overrides-abstract-method-b.check
test/files/run/t7569.check
|
| | | |
| | | |
| | | |
| | | | |
Not sure which partest bug allowed this, but the old name was wrong.
|
| |\ \ \
| | | | |
| | | | | |
SI-7455 Drop dummy param for synthetic access constructor
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Java synthesizes public constructors in private classes to
allow access from inner classes. The signature of
that synthetic constructor (known as a "access constructor")
has a dummy parameter appended to avoid overloading clashes.
javac chooses the type "Enclosing$1" for the dummy parameter
(called the "access constructor tag") which is either an
existing anonymous class or a synthesized class for this purpose.
In OpenJDK, this transformation is performed in:
langtools/src/share/classes/com/sun/tools/javac/comp/Lower.java
(Incidentally, scalac would just emits a byte-code public
constructor in this situation, rather than a private constructor /
access constructor pair.)
Scala parses the signature of the access contructor, and drops
the $outer parameter, but retains the dummy parameter. This causes
havoc when it tries to parse the bytecode for that anonymous class;
the class file parser doesn't have the enclosing type parameters
of Vector in scope and crash ensues.
In any case, we shouldn't allow user code to see that constructor;
it should only be called from within its own compilation unit.
This commit drops the dummy parameter from access constructor
signatures in class file parsing.
|
| |\ \ \ \
| | | | | |
| | | | | | |
SI-7636 Fix a NPE in typing class constructors
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
If we encountered an erroneous super call due to a
failure in parent type argument inference, we must
avoid inspecting the untyped children of erroneous
trees.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
introduced in 5b54681: the end position of Postfix operators should
take the operator length into account.
review by @som-snytt
|
| |/ / / /
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Currently we allow macros to override non-abstract methods (in order
to provide performance enhancements such as foreach for collections),
and we also disallow macros to override abstract methods (otherwise
downcasting might lead to AbstractMethodErrors).
This patch fixes an oversight in the disallowing rule that prohibited
macros from overriding a concrete method if that concrete method itself
overrides an abstract method. RefCheck entertains all overriding pairs,
not only the immediate ones, so the disallowing rule was triggered.
Now macros can override abstract methods if and only if either the base
type or the self type contain a matching non-abstract method.
|
| |\ \ \ \
| | | | | |
| | | | | | |
SI-7336 Link flatMapped promises to avoid memory leaks
|
| | |/ / / |
|
| |\ \ \ \
| | | | | |
| | | | | | |
SI-7265 General test for spec version
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
The test for isJavaAtLeast uses the specification.version.
The method argument must have the form "major.minor".
The scaladoc is updated to reflect the new reality and a
test is added under junit.
Note that this implementation aims to be a simple
compromise between the functional and imperative camps,
that is, to be free of both closures and while loops.
And to elicit no cruft like regexes and wrappers for strings.
No doubt even more could be done in this department, but we
don't wish to spoil the fun on codegolf.stackexchange.com.
However, we might decide to sponsor a new site:
codereviewpingpong.com
For 2.10.x, javaSpecVersion is provided as a private member.
The active test is under `run` and the `junit` test must
bide its time in `pending`.
For 2.11, the private members can be public and the app test
replaced with the unit test.
|
| |\ \ \ \ \
| | | | | | |
| | | | | | | |
SI-7649 Fix positions for reshaped tag materializers
|
| | | |/ / /
| | |/| | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Calls to `materializeClassTag[T]` are replaced during reification with
`implicitly[ClassTag[T]]` in the `reify` macro. This is done to avoid
referring to symbols in scala-compiler.jar. Class- and Type-Tag
materialization is treated in the same way.
This commit positions the replacement trees to avoid triggering
assertions under -Yrangepos.
|
| |\ \ \ \ \
| | | | | | |
| | | | | | | |
SI-7617 typedAssign no longer expands lhs
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
This makes sure that setter and updateDynamic macros work as intended
rather than in some cases expanding incorrectly or prematurely.
Setter invocations are desugared from assignments of values to getters.
If a typecheck of an assignment's lhs yields an invocation of a getter,
then the assignment is rewritten into an invocation of a setter. However
if a getter is a macro, then it just expands, destroying the prerequisite
for desugaring. Therefore we need to disable expansion for the typecheck
of an lhs.
Similar thing happens to updateDynamic that first desugars a getter
invocation into q"$target.updateDynamic($fieldName)" and then expects
typedAssign to rewrite the corresponding Assign node into an additional
application of a partially applied updateDynamic to a rhs. Here we also
need to disable the typecheck of an lhs, because macros cannot be
partially applied.
|
| | |/ / / /
| |/| | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
The crash was caused by a symbol lookup to rewire the super calls,
done after pickler, but specialization added new traits and new
members, thus making the super rewiring impossible. To avoid such
problems, this patch moves symbol lookup after specialization,
so the changes done by specialization (and miniboxing) become
visible to mixin.
NOTE: This patch will be followed by a similar patch to master.
Review by @adriaanm or @retronym.
|
| |\ \ \ \ \
| | | | | | |
| | | | | | | |
SI-7344 Specialize methods in private scopes
|
| | | |/ / /
| | |/| | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
This performs method specialization inside a scope other than a {class,
trait, object}: could be another method or a value. This specialization
is much simpler, since there is no need to record the new members in
the class signature, their signatures are only visible locally.
It works according to the usual logic:
- we use normalizeMember to create the specialized symbols
- we leave DefDef stubs in the tree that are later filled in by tree
duplication and adaptation
The solution is limited by SI-7579: since the duplicator loses the sym
annotations when duplicating, this expansion and rewiring can only take
place in code that has not been subject to duplication. You can see the
test case for an example.
Review by @dragos, @paulp or @axel22.
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
SI-7668 Better return type inheritance for dep. method types
|
| | |_|_|/ /
| |/| | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Return type inheritance already handles substitution of
type parameters of the overriding method for those of the
overriding.
This commit extends this to do the same for parameter symbols.
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
SI-7669 Fix exhaustivity warnings for recursive ADTs.
|
| |/ / / / /
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
The pattern matcher's analysis was correctly finding
models under which the match in the enclosed test
could fail. But, when trying to render that model
as a counter example, it ran into an internal inconsistency
and gave up.
That inconsistency arose from VariableAssignment, which:
> turn the variable assignments into a tree
> the root is the scrutinee (x1), edges are labelled
> by the fields that are assigned a node is a variable
> example (which is later turned into a counter example)
In the process, it notes the unreachable case `V2 = NotHandled`,
which can only arise if `V1 = Op`, ie the scrutinee is `Op(NotHandled())`.
V2 is assosicated with the path `x1.arg`. The code then looked for
any variable assosicated with the prefix `x1` and registered that its
field `arg` was assosicated with this variable assignment.
However, the assignment for `V1 = NotHandled` (another missing case)
is also associated with the path `x1`. Registering this field makes
no sense here; we should only do that for `Op`.
This commit conditionally registers the fields based on the class
of `VariableAssignment#cls`. We no longer hit the inconsistency in
`VariableAssignment#allFieldAssignmentsLegal`.
This favourably changes the results of two existing tests.
I had to tweak the counter example pruning to avoid relying on
CounterExample.==, which is flaky in the light of Nil and List().
It is possible to have:
A, B where A != B && A.coveredBy(B) && B.coveredBy(A)
Luckily it is straightforward to implement pruning entirely with
coveredBy.
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
SI-7620 Remove floating-point-literals-without-digit-after-dot
|
| | | | | | | |
|
|\ \ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
SI-7689 Fix typing regression with default arguments
|
| | |_|_|_|_|/
| |/| | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Regressed in e28c3edda4. That commit encoded upper/lower bounds
of Any/Nothing as EmptyTree, which were triggering the .isEmpty
check in Namers#TypeTreeSubstitutor and resulting in the default
getter having TypeTree() as the return type. This resulted in a
"missing parmameter type" error.
This commit tightens up that condition to only consider empty
TypeTrees (those wrapping null or NoType.)
|
|\ \ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
SI-7695 Macro debug output on -explaintypes
|
| |/ / / / / /
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
It looks like checkConforms should wait for error before
using explainTypes, rather than turning on macro debug
trace if explaintypes is set.
In particular, macro debug output is Console.println
instead of reporter.echo or similar, so partest can't
test it.
|
|\ \ \ \ \ \ \
| |/ / / / / /
|/| | | | | | |
SI-7488 REPL javap finds new style delayedEndpoint
|