| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
| |
In January I submitted a pull request that, as I thought back then,
fixes SI-5923: https://github.com/scala/scala/commit/fe60284769.
The pull request was merged, and everyone was happy that the bug got fixed.
Unfortunately, the fix was: a) incomplete, b) broke something else,
as noticed by Miles in https://groups.google.com/d/topic/scala-internals/7pA9CiiD3u8/discussion.
Now we got a real fix in 2.10.x (https://github.com/scala/scala/commit/90ac5c4e13),
and it's my pleasure to port it to master.
|
|\
| |
| | |
SI-7432 Range.min should throw NoSuchElementException on empty range
|
| | |
|
| |
| |
| |
| |
| | |
For consistency, range.max and range.min should throw
NoSuchElementException on an empty range.
|
|\ \
| | |
| | | |
Par-Test includes log in transcript of failed exec
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The previous behavior was that the Failure is generated
before the log is appended to the transcript.
That meant that the summary transcripts wouldn't include
the log file. Luckily, the transcript would say something
like "jvm > showFail-run.log".
|
|\ \ \
| | | |
| | | | |
Boil out some duplicated parser logic.
|
| | | |
| | | |
| | | |
| | | | |
Our focus today is on packages and package objects.
|
|/ / / |
|
|\ \ \
| | | |
| | | | |
SI-6863 root cause fixed using factory of scala.runtime.*Ref
|
| | | | |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This commit does away with an error-prone division of labor between
UnCurry and LambdaLift, a division of labor by which UnCurry had to
anticipate under which circumstances LambdaLift creates a
scala.runtime.*Ref whose initial value is given by a an expression
including a Try in non-statement position. That sounds complicated,
and it is.
The solution so far (fixing SI-6863) is replaced by a simpler approach,
at the cost of forward binary comptability with pre-2.11 releases,
this time fixing the root cause of SI-6863.
From now on, a s.r.*Ref is instantiated via invocation of
a static factory method in the s.r.*Ref class in question.
Unlike the code that was emitted so far (which involved
NEW refclass, DUP, expr, INVOKESPECIAL refclass.<init>)
the "expr" doesn't appear on the operand stack on top
of the *Ref value being initialized. In other words,
the *Ref initialization is in statement position provided "expr" is.
|
|\ \ \ \
| |_|/ /
|/| | | |
Partest can --show-diff again after incremental report.
|
| | | |
| | | |
| | | |
| | | |
| | | | |
A flag is set in NestUI to look for "diff" in the transcript
of failing tests.
|
|\ \ \ \
| | | | |
| | | | | |
Hardening against nulls for deserialization.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
When one attempts to populate data structures via
deserialization, nulls tend to show up in unlikely or
"impossible" places. Now there are a few fewer.
|
|\ \ \ \ \
| |/ / / /
|/| | | | |
Absolutized paths involving the scala package.
|
|/ / / /
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Confusing, now-it-happens now-it-doesn't mysteries lurk
in the darkness. When scala packages are declared like this:
package scala.collection.mutable
Then paths relative to scala can easily be broken via the unlucky
presence of an empty (or nonempty) directory. Example:
// a.scala
package scala.foo
class Bar { new util.Random }
% scalac ./a.scala
% mkdir util
% scalac ./a.scala
./a.scala:4: error: type Random is not a member of package util
new util.Random
^
one error found
There are two ways to play defense against this:
- don't use relative paths; okay sometimes, less so others
- don't "opt out" of the scala package
This commit mostly pursues the latter, with occasional doses
of the former.
I created a scratch directory containing these empty directories:
actors annotation ant api asm beans cmd collection compat
concurrent control convert docutil dtd duration event factory
forkjoin generic hashing immutable impl include internal io
logging macros man1 matching math meta model mutable nsc parallel
parsing partest persistent process pull ref reflect reify remote
runtime scalap scheduler script swing sys text threadpool tools
transform unchecked util xml
I stopped when I could compile the main src directories
even with all those empties on my classpath.
|
|\ \ \ \
| |/ / /
|/| | | |
Rewrite TailCalls for performance and immutability.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
While logging symbols created after typer, I discovered that
TailCalls was far and away the largest creator. It turns out
this was due to a bug where thousands of labels were eagerly
created during tail call analysis, even if the method weren't
tail recursive and no label would ever be required.
This commit shaves 10% off the total number of method symbol
creations (compiling quick.lib drops from 88K to 80K.)
|
|\ \ \ \
| | | | |
| | | | | |
Merge 2.10.x
|
| |\ \ \ \
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Conflicts:
bincompat-forward.whitelist.conf
src/compiler/scala/tools/nsc/matching/Patterns.scala
src/compiler/scala/tools/nsc/transform/patmat/Logic.scala
src/compiler/scala/tools/nsc/typechecker/Infer.scala
src/scaladoc/scala/tools/nsc/doc/model/ModelFactory.scala
test/files/neg/t5663-badwarneq.check
|
| | |\ \ \ \
| | | | | | |
| | | | | | | |
use relative symlink in distpack
|
| | |/ / / /
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
To simplify building a release on jenkins, we run distpack-opt in one job,
store the `dists/` directory in a tar ball, archive that artifact and
copy it to the downstream jobs that package on windows and unix.
To make the tarball portable between machines, it must not use absolute symlinks.
|
| | |\ \ \ \
| | | | | | |
| | | | | | | |
SI-6532 emit debug info in compiled java.
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Our handful of java source files weren't being compiled
with line numbers, sourcefile, and other debugger aids.
I don't really know how to test this so I'll enclose an
excerpt of the bytecode diff of scala.runtime.IntRef to show
that this change results in debug information.
2,3c2,4
> Compiled from "IntRef.java"
4a6
> SourceFile: "IntRef.java"
53a62,67
> LineNumberTable:
> line 18: 0
> LocalVariableTable:
> Start Length Slot Name Signature
> 0 10 0 this Lscala/runtime/IntRef;
> 0 10 1 elem I
62a77,81
> LineNumberTable:
> line 19: 0
> LocalVariableTable:
> Start Length Slot Name Signature
> 0 8 0 this Lscala/runtime/IntRef;
|
| | |\ \ \ \ \
| | | |/ / / /
| | |/| | | | |
Warn on selection of vals from DelayedInit subclasses.
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Which are likely to yield null, if the program didn't start.
This is a common source of confusion for people new to
the language, as was seen during the Coursera course.
The test case shows that the usage pattern within Specs2
won't generate these warnings.
|
| | |\ \ \ \ \
| | | | | | | |
| | | | | | | | |
SI-7369 Avoid spurious unreachable warnings in patterns
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
Unreachability analysis draws on the enumerated domain of types
(e.g sealed subclasses + null, or true/false), and also looks at all
stable identifier patterns tested for equality against the same 'slot'
in a pattern.
It was drawing the wrong conclusions about stable identifier patterns.
Unlike the domain constants, two such values may hold the same value,
so we can't assume that matching X precludes matching Y in the same
slot in a subsequent case.
For example:
val X: Boolean = true; val Y: Boolean = true
def m1(t1: Tuple1[Boolean]) = t1 match {
case Tuple1(true) =>
case Tuple1(false) =>
case Tuple1(false) => // correctly unreachable
}
def m2(t1: Tuple1[Boolean]) = t1 match {
case Tuple1(X) =>
case Tuple1(Y) => // spurious unreachable warning
}
//
// Before
//
reachability, vars:
V2: Boolean ::= true | false// Set(false, Y, X, true) // = x1._1
V1: (Boolean,) ::= null | ... // = x1
equality axioms:
V2=true#4 \/ V2=false#5 /\
-V2=false#5 \/ -V2=Y#3 /\
-V2=false#5 \/ -V2=X#2 /\
-V2=false#5 \/ -V2=true#4 /\
-V2=Y#3 \/ -V2=X#2 /\
-V2=Y#3 \/ -V2=true#4 /\
-V2=X#2 \/ -V2=true#4
//
// After
//
reachability, vars:
V2: Boolean ::= true | false// Set(false, Y, X, true) // = x1._1
V1: (Boolean,) ::= null | ... // = x1
equality axioms:
V2=true#4 \/ V2=false#5 /\
-V2=false#5 \/ -V2=true#4
|
| | |\ \ \ \ \ \
| | | | | | | | |
| | | | | | | | | |
SI-7367 scaladoc crash on constructing the model for annotations.
|
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
Scaladoc only checks primary constructor when building annotation
model.
Here we instead find the constructor matching the annotation's symbol.
Also change TreeFactory.makeTree to return TreeEntity rather than
Option[TreeEntity] and force the caller check for EmptyTree.
|
| | |\ \ \ \ \ \ \
| | | | | | | | | |
| | | | | | | | | | |
Corrects link in README.rst
|
| | |/ / / / / / / |
|
| | |\ \ \ \ \ \ \
| | | | | | | | | |
| | | | | | | | | | |
Update links to old website, in preparation for launch.
|
| | |/ / / / / / /
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
Removed the contact form, since it's redundant with mailing lists and
issue tracker.
|
| | |\ \ \ \ \ \ \
| | | | | | | | | |
| | | | | | | | | | |
SI-6943 warn on value class miscomparison.
|
| | |/ / / / / / /
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
There's a very dangerous situation running around when you
combine universal equality with value classes:
// All over your code
val x = "abc"
if (x == "abc") ...
// Hey let's make x a value class
val x = new ValueClass("abc")
// Uh-oh
There was until now no warning when comparing a value class
with something else. Now there is.
|
| | |\ \ \ \ \ \ \
| | | | | | | | | |
| | | | | | | | | | |
SI-6675 Avoid spurious warning about pattern bind arity.
|
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
In 692372ce, we added a warning (under -Xlint) when binding
a `TupleN` in to a single pattern binder, which wasn't allowed
before 2.10.0, and more often than not represents a bug.
However, that warning overstretched, and warned even when
using a Tuple Pattern to bind to the elements of such a value.
This commit checks for this case, and avoids the spurious warnings.
A new test case is added for this case to go with the existing
test for SI-6675:
$ ./tools/partest-ack 6675
% tests-with-matching-paths ... 3
% tests-with-matching-code ... 2
# 3 tests to run.
test/partest --show-diff --show-log \
test/files/neg/t6675-old-patmat.scala \
test/files/neg/t6675.scala \
test/files/pos/t6675.scala \
""
Testing individual files
testing: [...]/files/pos/t6675.scala [ OK ]
Testing individual files
testing: [...]/files/neg/t6675-old-patmat.scala [ OK ]
testing: [...]/files/neg/t6675.scala [ OK ]
All of 3 tests were successful (elapsed time: 00:00:03)
|
| | |\ \ \ \ \ \ \ \
| | | | | | | | | | |
| | | | | | | | | | | |
SI-7355 Handle spaces in paths in Windows batch files.
|
| | |/ / / / / / / /
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
Changed "%1%" and %2% to "%~1" and %~2 to allow spaces
in paths by surrounding quotes according to advice at:
http://stackoverflow.com/questions/473117/pass-path-with-spaces-as-parameter-to-bat-file
http://ss64.com/nt/syntax-args.html
|
| | |\ \ \ \ \ \ \ \
| | | |_|_|/ / / / /
| | |/| | | | | | | |
Interactive scaladoc: demand new typer run when done.
|
| | | | |/ / / / /
| | | |/| | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
As of now, when backgroundCompile is in the same typer run as
scaladoc-fetching logic, typer is confused with stale symbols.
|
| | |\ \ \ \ \ \ \
| | | | | | | | | |
| | | | | | | | | | |
SI-7330 better error when pattern's not a value
|
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
Somehow an applied type managed to sneak past the type checker in pattern mode.
Patterns must be values, though.
`case C[_] =>` was probably meant to be `case _: C[_] =>`
Advice is dispensed accordingly. (Generalizing the existing advice machinery.)
|
| | |\ \ \ \ \ \ \ \
| | | | | | | | | | |
| | | | | | | | | | | |
Quiet down overloaded implicit warning.
|
| | | | |_|/ / / / /
| | | |/| | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
Apparently implicit classes product both a method symbol and
a module symbol, both of which are marked implicit, which left
this warning code believing there was an overloaded implicit
method.
|
| | |\ \ \ \ \ \ \ \
| | | |_|_|_|/ / / /
| | |/| | | | | | | |
SI-7200 Test case for fixed type inference error.
|
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
Broken in 2.9.2 and 2.10.0, but working in 2.10.1
--- sandbox/2.10.0.log
+++ sandbox/2.10.1.log
def coflatMap[A >: Nothing <: Any, B >: Nothing <: Any](f: Test.Nel[A] => B): Test.Nel[A] => Test.Nel[B] = ((l: Test.Nel[A]) => Test.this.Nel.apply[B](f.apply(l), l.tail match {
case immutable.this.Nil => immutable.this.Nil
- case (hd: A, tl: List[A])scala.collection.immutable.::[A]((h @ _), (t @ _)) => {
- val r: Test.Nel[Nothing] = NelFoo.this.coflatMap[A, Nothing](f).apply(Test.this.Nel.apply[A](h, t));
+ case (hd: A, tl: List[A])scala.collection.immutable.::[?A1]((h @ _), (t @ _)) => {
+ val r: Test.Nel[B] = NelFoo.this.coflatMap[A, B](f).apply(Test.this.Nel.apply[A](h, t));
{
- <synthetic> val x$1: Nothing = r.head;
- r.tail.::[Nothing](x$1)
+ <synthetic> val x$1: B = r.head;
+ r.tail.::[B](x$1)
}
}
}))
b74c33eb86 represents the exact moment of progression. Comments
in pos/t7200b.scala, a minimal test that demonstrates the problem
without type constructors or code execution, pinpoint the line of
code responsible for the fix.
Incidentally, I'm currently on a train somewhere between Solothurn
and Biel, and am consequently without the power of scala-bisector.
Undeterred, and inspired by a line I saw in Skyfall last night
("sometimes the olds ways are better"), I just pulled off a two-hop
bisection. Take that, O(log N)!
The one remaining worry is the appearance of the type variable
?A1 in the output of -Xprint:typer for run/t7200.scala.
|