| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Runtime reflection in JavaMirrors previously forgot to fill in
@throws when importing Java reflection artifacts. Now this is fixed.
Note that generic exception types used in `throws` specifications will
be garbled (i.e. erased), because we don't use `getGenericExceptionTypes`
in favor of just `getExceptionTypes` to stay compatible with the behavior
of ClassfileParser. That's a bug, but a separate one and should be fixed
separately.
Also note that this commit updated javac-artifacts.jar, because we need
to test how reflection works with javac-produced classfiles. The sources
that were used to produce those classfiles can be found in the jar next
to the classfiles.
|
|\
| |
| | |
10 backports
|
| |
| |
| |
| |
| |
| |
| |
| | |
[backport]
Saw this by accident; the trees created for early defs would
wholesale replace the modifiers with PRESUPER rather than
combining them. FINAL was lost that way, as would be any other
modifiers which might be valid there.
|
| |
| |
| |
| |
| | |
[backport]
Nesting recursive calls in Stream is always a dicey business.
|
| |
| |
| |
| |
| | |
[backport]
Prohibit `_` as an identifier, it can only bring badness.
|
| |
| |
| |
| |
| |
| |
| |
| | |
[backport]
You don't want to do name-based selections in later phases
if you can help it, because there is nobody left to resolve
your overloads. If as in this example you're calling a
known method, use the symbol. Review by @hubertp.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
[backport]
mkAttributedSelect, which creates a Select tree based on
a symbol, has been a major source of package object bugs,
because it has not been accurately identifying selections
on package objects. When selecting foo.bar, if foo turns
out to be a package object, the created Select tree must be
foo.`package`.bar
However mkAttributedSelect was only examining the owner of
the symbol, which means it would work if the package object
defined bar directly, but not if it inherited it.
|
| |
| |
| |
| |
| | |
[backport]
And other polishing related to varargs handling.
|
| |
| |
| |
| |
| | |
[backport]
The fix of course is a perfect error message.
|
| |
| |
| |
| |
| | |
[backport]
Remove some code, win a prize.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
[backport]
This was a bad interaction between anonymous subclasses
and bridge methods.
new Foo { override def bar = 5 }
Scala figures it can mark "bar" private since hey, what's
the difference. The problem is that if it was overriding a
java-defined varargs method in scala, the bridge method
logic says "Oh, it's private? Then you don't need a varargs
bridge." Hey scalac, you're the one that made me private!
You made me like this! You!
Conflicts:
src/compiler/scala/tools/nsc/typechecker/RefChecks.scala
|
| |
| |
| |
| |
| |
| |
| |
| | |
[backport]
The original fix for SI-2418 excluded final vars entirely, but
the problem was not final vars per se, but the emission of ACC_FINAL
in combination with ACC_VOLATILE. Since vars never get ACC_FINAL
now, this is no longer an issue.
|
|\ \
| | |
| | | |
[backport] SI-6301 / SI-6572 specialization regressions
|
| | |
| | |
| | |
| | |
| | |
| | | |
That fix has now been backported to 2.10.x in the
previous commit. This commit should be be merged
to master.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Squashed commit of the following:
commit a3680be29ccd5314c5d027d473b37940eaecd530
Author: Paul Phillips <paulp@improving.org>
Date: Fri Aug 31 10:20:16 2012 -0700
Actual fix for SI-6301, specialized crasher.
This means the workaround in the previous commit is no
longer reached, but it should remain where it is as a much
needed layer of robustness/useful error reporting.
Conflicts:
src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala
src/compiler/scala/tools/nsc/typechecker/Duplicators.scala
commit f4c45ae204ce3ff3c16b19cab266d0b6515b6e0f
Author: Paul Phillips <paulp@improving.org>
Date: Fri Aug 31 10:49:24 2012 -0700
Rewrite of GenICode adapt.
Started for debuggability, stayed for clarify/performance.
Conflicts:
src/compiler/scala/tools/nsc/backend/icode/GenICode.scala
commit 74842f72a0af485e5def796f777f7003f969d75b
Author: Paul Phillips <paulp@improving.org>
Date: Fri Aug 31 08:45:34 2012 -0700
Workaround for SI-6301, @specialize crasher.
SpecializeTypes is generating symbols with overloaded types
which then proceed to crash in CleanUp or GenICode. Until I
or someone works out why that is, take a look in case the
overload is easily disambiguated by the argument list arity,
in which case warn and proceed.
|
|\ \ \
| | | |
| | | | |
[backport] SI-5378, unsoundness with type bounds in refinements.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
As the comment says:
Not enough to look for abstract types; have to recursively check
the bounds of each abstract type for more abstract types. Almost
certainly there are other exploitable type soundness bugs which
can be seen by bounding a type parameter by an abstract type which
itself is bounded by an abstract type.
SPECIAL: BUY ONE UNSOUNDNESS, GET ONE FREE
In refinement types, only the first parameter list of methods
was being analyzed for unsound uses of abstract types. Second
parameter list and beyond had free unsoundness reign. That bug
as well is fixed here.
|
|\ \ \ \
| | | | |
| | | | | |
SI-4714 Initialize history while initializing the REPL's reader
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
It was possible to get a command into the REPL before the history
recording object was set and so the command would be lost in the sands
of time. This fix just moves the initialization of the history object
into the JLineReader constructor, out of the post-init hook.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
[backport] Removed restriction on final vars, SI-2418.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Backport of b79c7600544db9964c228b94a2f70f3ed854f89b
The original fix for SI-2418 excluded final vars entirely, but
the problem was not final vars per se, but the emission of ACC_FINAL
in combination with ACC_VOLATILE. Since vars never get ACC_FINAL
now, this is no longer an issue.
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
[backport] the scanner is now less eager about deprecations
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Due to some reason, partest always enables -deprecation. Since Paul has
just submitted a pull request, which removes this behavior, I'm updating
the flags to make sure this test works even after Paul's change.
Backport from https://github.com/scala/scala/pull/1807
Original commit is https://github.com/scala/scala/commit/2015ad3ebd833225e93ed19604760a6da2522bb1
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
When healing braces it isn't very useful to report deprecation warnings,
especially since this process is just simple context-free skimming, which
can't know about what positions can accept what identifiers.
Backport from https://github.com/scala/scala/pull/1807.
Original commit is https://github.com/scala/scala/commit/e5d34d70499504e085ddf957c1c818ffb63f4e8d.
|
|\ \ \ \ \ \ \
| |_|_|/ / / /
|/| | | | | | |
evicts eponymous packages and objects from tests
|
| |/ / / / /
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
As I figured out from http://groups.google.com/group/scala-internals/browse_thread/thread/ace970a799dcf7a0,
current behavior with same-named objects silently taking precedence over
same-named packages is a bug and shouldn't be relied upon.
|
|\ \ \ \ \ \
| |_|/ / / /
|/| | | | | |
SI-7009: `@throws` annotation synthesized incorrectly
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
The 990b3c7 made `scala.throws` annotation polymorphic but forgot to
adapt compiler code that synthesizes it, e.g. when parsing class files.
The consequence was that we would get non-deterministically either
`scala.throws` or `scala.throws[T]` as a type for synthesized annotation.
The reason is that `Symbol.addAnnotation` would call `tpe` method which
does not initialization of symbol so type parameters list would not be
determined correctly. Only if info of that symbol was forced for other
reason we would get `scala.throws[T]`. That non-deterministic behavior
was observed in sbt's incremental compiler.
Another problem we have is that Scala allows polymorphic exceptions
so in ClassfileParser we could synthesize `@throws` annotation with
wrong (polymorphic) type applied. In such case the best we can do
is to convert such type to monomorphic one by introducing existentials.
Here's list of changes this commit introduces:
* The `Symbol.addAnnotation` that takes symbol as argument asserts
that the type represented by that symbol is monomorphic (disabled
due to cycles; see comments in the code)
* Introduce `Symbol.addAnnotation` overload that allows us to pass
an applied type
* Change all places where polymorphic annotations are synthesized
to pass an applied type
* Handle polymorphic exception types in
`ClassfileParser.parseExceptions`
Fixes SI-7009.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
The next commit fixes the problem itself and it's easier to see
in diff what's being fixed exactly.
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
SI-6968 Simple Tuple patterns aren't irrefutable
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Reverts part of c82ecab. The parser can't assume that
a pattern `(a, b)` will match, as results of
`.isInstanceOf[Tuple2]` can't be statically known until
after the typer.
The reopens SI-1336, SI-5589 and SI-4574, in exchange for fixing
this regression SI-6968. Keeping all of those fixed will require
a better definition of irrefutability, and some acrobatics to
ensure safe passage to the ambiguous trees through typechecking.
|
|\ \ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
SI-6669 Add . to the default scalap classpath
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
The default classpath for scalap did not include '.' which made it
behave differently from javap in an annoying way. This commit adds
it to the default. Also included is a test to make sure it's in
the default but does not corrupt a user specified classpath.
|
|\ \ \ \ \ \ \ \
| | | | | | | | |
| | | | | | | | | |
SI-6728 Fixes crash in parser on incomplete for expression
|
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
The parser was trying to take the position of an empty expression
which would crash. Son on the empty expression case in TreeBuilder#
makeWhile it tries to do that and, if that failed, gets a position
that wraps both the condition and the body.
I also made a slight improvement to the UnsupportedOperationEx
messages in Position.
|
|\ \ \ \ \ \ \ \ \
| |_|/ / / / / / /
|/| | | | | | | | |
Add Bytecode test (ASM-based) to partest.
|
| | |_|_|_|_|/ /
| |/| | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
This commit introduces a new kind of test `Bytecode` that allows
one to inspect bytecode generated for given piece of Scala code.
The bytecode inspection is achieved by inspection of ASM trees.
See the included example for details.
NOTE: This commit does not introduce a new category of pratest tests.
Bytecode tests should be run in `jvm` category of partest tests.
Specific list of changes:
* Add BytecodeTest that contains common utilities to partest
* Add asm to classpath when compiling partest. That's not a
new dependency as it's being already done for javac task
we were running while compiling partest.
* Add an example test that shows how to count null checks in
given method.
|
|\ \ \ \ \ \ \ \
| | | | | | | | |
| | | | | | | | | |
SI-7035 Centralize case field accessor sorting.
|
| | |_|/ / / / /
| |/| | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
It is both burdensome and dangerous to expect callers
to reorder these. This was seen in the field permutation
in the unapply method; a regression in 2.10.0.
|
|\ \ \ \ \ \ \ \
| |_|_|/ / / / /
|/| | | | | | | |
Optimization in AsSeenFromMap.
|
| | |/ / / / /
| |/| | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Despite all the eyes which have traveled over this code,
we all managed to miss this:
// Note that pre and clazz are fixed at construction
class AsSeenFromMap(pre: Type, clazz: Symbol) {
...
def apply(tp: Type): Type =
if (skipPrefixOf(pre, clazz)) tp
else ...
}
Additionally, the exclusion condition in asSeenFrom contained
a useless check, here:
// !isPossiblePrefix(clazz) alone is enough
pre.normalize.isTrivial && !isPossiblePrefix(clazz)
|
|\ \ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
[retarget #1994 to 2.10.x] SI-6726 Improving pattern matcher analysis performance
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
In favour of a somber val.
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
Manually fuse `.filterNot(..).map` in dropUnit.
Before:
real 1m23.574s
user 1m51.795s
sys 0m2.634s
After:
real 1m4.883s
user 1m30.754s
sys 0m1.776s
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
For the test case: https://issues.scala-lang.org/browse/SI-6726?focusedCommentId=61207&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-61207
time scalac -Ystatistics -Ystop-after:patmat sandbox/gen.scala
Before:
real 1m47.737s
user 2m14.314s
sys 0m2.783s
After:
real 1m23.574s
user 1m51.795s
sys 0m2.634s
|
| | |_|_|_|_|/
| |/| | | | |
| | | | | | |
| | | | | | | |
To be manually run, results referenced in subsequent commmits.
|
|\ \ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
[backport] Fix for SI-6154, VerifyError originating in uncurry.
|
| | |/ / / / /
| |/| | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Lhs still might be an Ident. Miguel did all the work,
I just wrote it down in code form.
(cherry picked from commit 48f8235822a2a100d6c4e8d3d7349df565ac6d40)
|
|\ \ \ \ \ \ \
| |_|/ / / / /
|/| | | | | | |
SI-6516, macros comparing types with == instead of =:=.
|
|/ / / / / /
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
I gift-wrapped this ticket four months ago:
'I think it will be enough to say "tpe =:= MacroContextClass.tpe"
rather than == .'
Indeed. Had to open my own gift. Thanks, paulp!
|