| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The unmoored DocComment is created more eagerly so that its position
is correct despite subsequent line comments. (Previously, skipComment
would advance docPos.)
It looks like the error caret is still off by one when a doc comment
shows up in the middle of an operator, and who doesn't scaladoc the
interior of expressions?
Another bug fixed by Paul's refactor is that additional comments
between the doc and the entity no longer breaks the scaladoc.
Test added.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Double-star doc comments in non-dockable positions at the end of a block
will emit a warning only if API tags like @author are present, or under
-Xlint.
A real comment parser is applied early to probe for tags, to minimize
ad hoc testing or duplication, but warnings are suppressed. Residual
ad hockiness lies in precisely which tags to warn on. Ad hoc or ad doc.
This fix is a stop gap; a richer solution would also report about other
doc locations that won't be processed.
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* origin/2.10.x:
if starr.use.released fetch Scala ${starr.version} for STARR
assume build.release when maven.version.suffix is set
make quick.done depend on quick.bin again
SI-7321 Memory leak in specialize on multiple compiler runs.
Take the N^2 out of the compiler's TreeSet.
SI-6900 Fix tailrec for dependent method types
Simplify interplay between Uncurry Info- and Tree-Transformers
Refactor existential related code out of types.
Add a cautionary comment to TreeSymSubstitutor.
SI-6715 Shouldn't return "" from TermNames.originalName
Backport #2289's TermNames.unexpandedName as TermNames.originalName
SI-7147 Diagnostic for unexplained assertion in presentation compiler.
SI-6793 Don't use super param accessors if inaccessible.
Correct sorting example for Ordering in scaladoc
Conflicts:
bincompat-backward.whitelist.conf
bincompat-forward.whitelist.conf
build.xml
src/compiler/scala/tools/nsc/transform/UnCurry.scala
src/reflect/scala/reflect/internal/StdNames.scala
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Uncurry's info transformer could generate a MethodType
with cloned parameter symbols. This type was used
for the LabelDef generated in the TailCalls phase.
But, the RHS of the method still contains types that
refer to the original parmameter symbol. Spurious
type errors ensued.
I've spent a good chunk of time pursuing a more
principled fix, in which we keep the symbols in the
tree in sync with those in the MethodType. You can
relive the procession of false dawns:
https://github.com/scala/scala/pull/2248
Ultimately that scheme was derailed by a mismatch
between the type parameter `T` and the skolem `T&`
in the example below.
trait Endo[A] { def apply(a: => A): A }
class Test {
def foo[T] =
new Endo[(T, Unit)] {
def apply(v1: => (T, Unit)) = v1 // no bridge created
}
}
Interestingly, by removing the caching in SingleType,
I got past that problem. But I didn't characterize it
further.
This commit sets asides the noble goal of operating in
the world of types, and sledgehammers past the crash by
casting the arguments to and the result of the label jump
generated in TailCalls.
|
| |\
| | |
| | | |
SI-6793 Don't use super param accessors if inaccessible.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
"Alias replacement" has been with us since 2005 (13c59adf9).
Given:
package a {
class C1(val v0: String)
class C2(v1: String) extends a.C1(v1) { v1 }
}
The reference to `v1` is rewritten as `C2.super.v0()`, and
no field is generated in `C2`.
(Oddly, this optimization doesn't seem to kick in if
these classes are in the empty package. That's probably
a distinct bug.)
However, this rewriting is done without consideration of
the accessibility of `v0` from `C2`.
This commit disables this optimization if there if `v0` is
not accessible.
|
| | | |
|
|\ \ \
| | | |
| | | | |
Wonderfulizing isSameType
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
A highly satisfying rewrite of isSameType. It's faster, clearer,
shorter, better commented, and closer to correct. I am especially
pleased that t5580b stopped compiling, given that nobody seemed to
have much idea why it compiled in the first place.
|
|\ \ \ \
| | | | |
| | | | | |
Add float version of the double NaN tests
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
The double version uncovered a bug in Avian already,
so let's be safe and cover all the NaNs we have.
|
|\ \ \ \ \
| |_|/ / /
|/| | | | |
SI-7300 single line comment in multi line comment
|
| |/ / /
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This issue was fixed in 3d5c675982 but didn't get any test cases,
which are added by this commit.
Before, a single line comment that occurred before a closing multi
line comment, like in `/*//*/`, was not treated as the beginning of
a nested comment, thus the shown example was parsed as a valid
comment.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This is Paul's test demonstrating that Javac errors are
correctly transcribed in the test transcript.
A gratuitous Scala class is added to a later round to
show that the test halts after the first error.
The runner must supply absolute paths to javac so that
absolute paths are reported in errors and stripped away
by partest.
The check file is differentiated for Java 6 and 7,
and partest's runner will now post-process the
`diff log check` to strip the diff which does not apply.
|
|/ / /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Paulptest includes color and simplified test scarfing.
Scalap tests are moved to the conventional name and location.
Testicolor missed out on Josh Suereth's tweak to sort the files in
a compilation round. Restore sortiness to test sources.
Testicolor is due to one of Paul's branches on a timeline
that apparently did not include the destruction of planet
Earth and its colonies by the Xindi.
Thanks also to Szabolcs Berecz for his merge effort. Merging
is thankless work, but not as thankless as merging in a
timeline that actually does terminate in the destruction of
your home world and Enterprise.
Archer had a supremely difficult choice: rescue humanity or
live out his retirement with T'Pol waiting on him hand and
foot? I'm sure I don't know how I'd choose.
|
|\ \ \
| | | |
| | | | |
SI-7110 Warn about naked try without catch/finally
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Before, this was allowed:
scala> try ( 1 / 0 )
java.lang.ArithmeticException: / by zero
But since the advent of util.Try, the subtle difference to the
following seems dangerous:
scala> import util.Try
import util.Try
scala> Try ( 1 / 0 )
res4: scala.util.Try[Int] = Failure(java.lang.ArithmeticException: / by zero)
Discussion: https://groups.google.com/d/topic/scala-language/fy2vXD_3fF8/discussion
There was some concern that this curtails a handy, temporary
way to remove the exception handlers from some code. But after
thinking about this, I contend that:
a) those people can easily stomach the warning temporarily
(modulo, of course, those with -Xfatal-warnings.)
b) putting this warning behind Xlint will disable it for those
who need it most: beginners.
I also chose not to refer to 'scala.util.Try' in the error message
as I think that has as much potential to confuse as it does to clarify.
|
|\ \ \ \
| | | | |
| | | | | |
SI-6168 Retain prefix when parsing types in JVM signatures
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
When reading Java classfiles, the generic signatures are
used to construct the corresponding Scala type signatures.
In the enclosed test case, the field `SomeClass.f` had
the JVM signature:
LContext<LSomeClass;>.Field<Ljava.lang.Integer;>;
The parser first (correctly) parsed the prefix as `Context[SomeClass]`.
It then looked up the type symbol for `Field` in that that type. It then
discarded the parsed prefix, and instead used the prefix from the
info of the type symbol: `Context[ParentType]`.
This commit changes the signature parser after the first `.` to
use the result of prior parsing as the prefix.
I've also included a test case with Java static inner classes,
which don't require any special treatment.
|
|\ \ \ \ \
| | |_|/ /
| |/| | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
topic/merge-2.10.x-to-v2.11.0-M2-74-g00e6c8b
Conflicts:
bincompat-backward.whitelist.conf
bincompat-forward.whitelist.conf
build.xml
src/compiler/scala/reflect/reify/utils/Extractors.scala
src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala
src/compiler/scala/tools/nsc/symtab/classfile/ICodeReader.scala
src/compiler/scala/tools/nsc/transform/patmat/MatchOptimization.scala
src/compiler/scala/tools/nsc/typechecker/Typers.scala
src/partest/scala/tools/partest/nest/ReflectiveRunner.scala
src/reflect/scala/reflect/internal/Types.scala
src/reflect/scala/reflect/runtime/JavaUniverse.scala
test/files/run/inline-ex-handlers.check
test/files/run/t6223.check
test/files/run/t6223.scala
test/scaladoc/scalacheck/IndexTest.scala
|
| |\ \ \ \
| | | | | |
| | | | | | |
Scaladoc: Load scripts at the bottom, and with a defer attribute
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
To improve latency on modern browsers (which supports defer) and old browsers:
* https://www.webkit.org/blog/1395/running-scripts-in-webkit/
* http://developer.yahoo.com/blogs/ydn/posts/2007/07/high_performanc_5/
|
| | | | | | |
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
We now use the unified diff format, hence the updated check files.
It's not clear to me how partest's classpath is managed,
but the approach in this commit works for the ant task and script invocation.
The diffutils jar is injected in the parent classloader.
|
| |\ \ \ \ \
| | | | | | |
| | | | | | | |
SI-7285 Fix match analysis with nested objects
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
The fix for SI-6146 introduced `nestedMemberType` to
enumerate sealed subtypes based on the (prefixed) type
of the scrutinee and the symbols of its sealed subclasses.
That method needed to widen `ThisType(modSym)`s to
`ModuleTypeRef(modSym)` before calling `asSeenFrom`.
However, this could lead to confused in the match analysis,
which sees `ModuleTypeRef` as distinct from singleton types
on the same modules (after all, they aren't =:=). Spurious
warnings ensued.
This commit makes two changes:
- conditionally re-narrow the result of `asSeenFrom` in `nestedMemberType`.
- present `a.b.SomeModule.type` as `SomeModule` in warnings emitted
by the pattern matcher.
|
| | | | | | | |
|
| |\ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
SI-7290 Discard duplicates in switchable alternative patterns.
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
- make a def a val, we only need to compute it once
- add a clarifying comment
- only report the first duplicate
|
| | |/ / / / /
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
The pattern matcher must not allow duplicates to hit the
backend when generating switches. It already eliminates then
if they appear on different cases (with an unreachability warning.)
This commit does the same for duplicated literal patterns in an
alternative pattern: discard and warn.
|
| |\ \ \ \ \ \
| | |_|/ / / /
| |/| | | | | |
SI-6387 Clones accessor before name expansion
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
When a symbol's name is expanded due to a conflict during
composition (e.g. multiple traits with same-named members, but
which are not both visible at the language level in the concrete
class) the compiler renames some symbols with expanded names which
embed the full name of the declaring class to avoid clashes.
In the rare cases when the accessor overrides the member in base
class, such expansion either results in AbstractMethodError when
the base method is abstract, or, even worse, can change the
semantics of the program.
To avoid such issues, we clone the accessor symbol, clear its
ACCESSOR flag and enter the symbol with an unchanged name.
|
| |\ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
SI-7246 Make $outer pointer elision Java aware
|
| | |/ / / / /
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
In e0853b3, a space-saving optimization elided the outer pointer
of inner classes if the the (protected) outer pointer of the
immediate parent class was guaranteed to point to the same instance.
But, this check failed to account for Java parent classes, which
don't follow the Scala scheme. This commit disables the optimization
in that case.
The original test case in e0853b3 was anemic, I've fleshed it out to:
- test the presense or absense of $outer pointers with Java reflection
- test the optimization works in the presense of aliased and annotated
aliased types. (The former worked already, the latter required a
change to the implementation.)
- Test the negative case when the prefixes don't line up and the
subclass in fact needs its own $outer.
This patch is based on work by Euguene Vigdorchik with some
additions by Jason Zaugg.
|
| |\ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
SI-7299 Improve error message for eta-expanding 23+ param method
|
| | | |_|_|_|/
| | |/| | | |
| | | | | | |
| | | | | | | |
Before, we got `error: missing arguments for method f`.
|
| |\ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
Read version 51 (JDK 7) class files.
|
| | | |/ / / /
| | |/| | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
This commit makes the ClassFileReader/ICodeReader parse class files
from JDK 7 (class file version 51). It does that by skipping over
the method handle related entries in the constant pool and by doing
some dummy processing on invoke dynamic instructions. The inliner
is updated to not try to inline a method with an invoke dynamic
instruction. A place holder INVOKE_DYNAMIC instruction is added to ICode
but it is designed to create an error if there's ever any attempt to
analyze it. Because the inliner is the only phase that ever tries
to analyze ICode instructions not generated from Scala source and
because Scala source will never emit an INVOKE_DYNAMIC, the place
holder INVOKE_DYNAMIC should never cause any errors.
A test is included that generates a class file with INVOKE_DYNAMIC
and then compiles Scala code that depends on it.
|
| |\ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
SI-6580 Scaladoc: Should not close void elements
|
| | | |/ / / /
| | |/| | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Because it will generate a useless element like "</img>".
To made matters worse, Scaladoc used to generate the element with
attributes (like </img src="...">). That's why we had SI-6580.
|
| |\ \ \ \ \ \
| | |/ / / / /
| |/| | | | | |
SI-6210 Test case for already-fixed pattern matcher bug
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
The fix arrived in SI-6022 / #1100 / 2.10.0-M7.
|
| |\ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
Build cleanup 2.10
|
| | |\| | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
Conflicts:
build.xml
|
| |\ \ \ \ \ \ \
| | |_|/ / / / /
| |/| | | | | | |
SI-7251, compiler crash with $.
|
| |\ \ \ \ \ \ \
| | |_|_|_|/ / /
| |/| | | | | | |
SI-7253: respect binary compatibility constraints
|
| | | |_|/ / /
| | |/| | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
From the JLS one can prove that moving a method to a superclass is a binary
compatible change, both forward and backward. That's because when compiling a
method call `c.foo()`, where c: C, the output descriptor *must* refer to `C` and
not to the class where `foo()` is actually defined.
This patch just ensures that, and adds a test comparing generated descriptors
against the Javac output.
The sample code is from Paul Philipps, the fix and the bytecode comparison code
from me.
From 2006 (9954eafffd5e60676238369ab0ed5797c92b4a7b, a fix for bug 455 in the
old bug tracker
http://www.scala-lang.org/sites/default/files/aladdin/displayItem.do%3Fid=455.html)
until 2.9, Scalac has followed this rule "often" (that is, when C is *not* an
interface).
This behavior was wrong, but the bug was hard to trigger. AFAICS, this can
create problems only when moving a method to a super interface in a library and
expecting forward binary compatibility - that is, compiling some Scala client
code against the new version of the library, and trying to run this code against
the old version of the library. This change grows an interface, so it is valid
only if clients are supposed to *not* implement the library. Apparently, this
is so rare that nobody noticed.
Since 2.10 (0bea2ab5f6b211a83bbf14ea46fe57b8163c6334), Scalac follows this rule
*only* when C is an interface (I assume by oversight, since the main change was
an accessibility check), so the bug was finally triggered.
The new code will have to emit INVOKEINTERFACE instead of INVOKEVIRTUAL a bit
more often, compared to 2.9 (but not to 2.10). I don't know whether
INVOKEINTERFACE is noticeably slower (it shouldn't be); but this is the safest
fix since this behavior is mandated by the JLS.
If somebody disagrees and believes the 2.9 is significantly faster, IMHO he
should send a separate pull request (although ProGuard is probably a better
place for the change).
|
| |\ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
SI-5699 correct java parser for annotation defs.
|
| | |/ / / / /
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Correct java source parser not to insert a constructor with the type
of its value method.
|
| |\ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
SI-7242 Fix crash when inner object mixes in its companion
|