| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| | |
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.
|
|\ \ \
| | | |
| | | | |
[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.
|
|\ \ \ \
| | | | |
| | | | | |
[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.
|
|\ \ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
[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)
|
| |_|_|_|_|/
|/| | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
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!
|
|\ \ \ \ \ \
| |_|_|/ / /
|/| | | | | |
SI-6651 Extension methods types may depend on the typed of the wrapped value
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
trait T { type U }
class A(val a: T) extends AnyVal {
def foo[TT <: a.U] = 0
}
It works! But it's pure serendipity. After extmethods,
the careful student of ASTs will find:
object A {
final def foo$extension[TT >: Nothing <: A.this.a.U]($this: A): Int = 0;
}
`A.this` doesn't belong.
For now we just include this case under our test umbrella.
|
| |/ / / /
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
This allows for the likes of:
class A[X](val x: X) extends AnyVal {
def foo(xy: x.Y) {}
}
We have to do this in both directions, when synthesizing
the extension method in `Extender#transform`, and later on
when Erasure tries to find the corresponding extension
methods by backing out the original signatures from
the signatures of the synthesized methods in the companion.
In the first case, we have to be careful to use a stable
reference to the `self` parameter, which can satisfy the
dependent types.
|
|/ / / /
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
It causes spurious failures - a typical example:
[partest] testing: [...]/files/run/t6987.scala [FAILED]
[partest] did not get the string expected, full results were:
[partest] Fast Scala compiler version 2.11.0-20130126-111937-f01e001c77 -- Copyright 2002-2013, LAMP/EPFL
[partest] [Given arguments: -shutdown -verbose]
[partest] [Transformed arguments: -shutdown -verbose -current-dir /localhome/jenkins/b/workspace/scala-checkin-manual]
[partest] [VM arguments: ]
[partest] java.net.ConnectException: Connection refused
[partest] [Connecting to compilation daemon at port 32808 failed; re-trying...]
[partest] [No compilation server running.]
[partest]
(cherry picked from commit 53d5df5c1d52b941732c243159de4f44456f03b4)
|
|\ \ \ \
| | | | |
| | | | | |
[backport] SI-3577 BoundedWildcardType handling
|
| | |/ /
| |/| |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
commit 3c91b32d699a9e29d685ac20c9805f96c9f2db2c
Author: Jason Zaugg <jzaugg@gmail.com>
Date: Fri Aug 24 01:16:47 2012 +0200
Mention BoundedWildcardType in "a standard type pattern match".
(cherry picked from commit 00e46b3dbcea2b72fd3941b7ffc2efba382871e9)
commit 0664be2b69b1ce013e937bc93f4e84b891676f1f
Author: Jason Zaugg <jzaugg@gmail.com>
Date: Fri Aug 24 01:05:07 2012 +0200
Make RefChecks#validateVariance aware of BoundedWildcardType.
The only test case that I know for this will be neutered
by the imminent fix for SI-6258; so I haven't been able to
test this.
But trying this manually, you can see that this patch defers the
the SI-6258 to the erasure phase.
Original:
scala.MatchError: ? (of class scala.reflect.internal.Types$BoundedWildcardType)
at scala.tools.nsc.typechecker.RefChecks$RefCheckTransformer$$anon$3.scala$tools$nsc$typechecker$RefChecks$RefCheckTransformer$$anon$$validateVariance$1(RefChecks.scala:894)
at scala.tools.nsc.typechecker.RefChecks$RefCheckTransformer$$anon$3.validateVariance(RefChecks.scala:965)
Modified:
java.lang.ClassCastException: scala.reflect.internal.Types$TypeRef$$anon$6 cannot be cast to scala.reflect.internal.Types$TypeBounds
at scala.reflect.internal.Types$TypeMap.mapOver(Types.scala:4160)
at scala.reflect.internal.transform.Erasure$ErasureMap.apply(Erasure.scala:156)
(cherry picked from commit 2b4e7183fd24113cca5e868456668fd05c848168)
commit 6ad651c94faf463133c742feb2aee59ef782ea1f
Author: Jason Zaugg <jzaugg@gmail.com>
Date: Fri Aug 24 00:54:59 2012 +0200
SI-3577 Make varianceInType aware of BoundedWildcardType.
(cherry picked from commit 21105654c40ed0c462142bcbb6c8eced77f8b07a)
|
|\ \ \ \
| |_|_|/
|/| | | |
SI-6891 Fix value class + tailrec crasher.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
rhs.substituteSymbols(old, new) leaves us with:
def loop#12225(x#12226: A#15491): scala#21.this.Unit#1615 =
loop#12225(x#12226)
In which the TermSymbol x#12226 has a stale info, pointing at
the A#7274, the class type parameter, rather than A#15491,
the corresponding type parameter of the synthetic backing
method.
I've improved `TreeSymSubstituter` to substitute not
only `Tree#{tpe, symbol}`, but also `DefTree#sym.info`.
The `pos` test that triggered the new code path are
listed here: https://gist.github.com/4575687
AFAICS, no special treatment of Function, Return, or Import
is needed in TreeSymSubstutor.
|
|\ \ \ \
| | | | |
| | | | | |
SI-4602 Make fsc absolutize source file names
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
The included test for fsc path absolutization almost certainly has
the same reliability problem as a similar test that was disabled in
https://github.com/scala/scala/pull/1985 . Disabling the test until
I can figure out a reliable way to test fsc in an our continuous
integration environment.
|
| | |/ /
| |/| |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
The fsc server was using a path supplied by the client to turn things
like class path values into absolute paths. But it wasn't absolutizing
the source file names supplied to the compiler which lead to SI-4602.
This commit adds that absolutizing bit and cleans the logic up a bit
so that the settings object isn't told a path that it already knows.
A test is included that simulates changing directory by forcing two
different -current-dir settings on two different compile sessions on
the same server process.
|
|\ \ \ \
| |_|_|/
|/| | | |
SI-6863 Fix verify error in captured var inited from block w try/catch
|