| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
Refines the previous commit by changing `Context#lookup` to
consider existential quantifiers, in the same manner as type
parameters, as exempt from consideration of the lookup prefix.
Furthermore, this logic is shared with `isInPackageObject`.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The typechecker rewrites `p.foo` to `p.<package>.foo` if `foo`
must come from a package object. This logic was overhauled in
51745c06f3, but this caused a regression.
I reverted to the predecessor of that commit to see how things
worked before. The lookup of the name `X` bound to the existential
quantifier, but incorrectly included the prefix `test.type` in the
result of the lookup. However, the subsequent call to
`isInPackageObject` (from `makeAccessible`) returned false, so
we didn't try to rewrite `X` to `test.<package>.X`.
This commit makes a minimal fix that makes `isInPackageObject`
return false for existentials.
|
|\
| |
| | |
change intArrayOps and friends return types for efficiency
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Remove object allocation overhead by peeling off abstraction layer,
revealing that the `ArrayOps` implicit conversions in `Predef`
return value classes.
d3f879a6b0 turned `ArrayOps.of<???>` into value classes,
but the non-`AnyVal` result type of the corresponding
`<???>arrayOps` implicit conversions (`ArrayOps[_]`) caused boxing anyway.
The optimized versions are introduced under a new name,
so that the old ones (without `implicit`) can be kept
for binary compatibility, for now.
|
|/ |
|
|
|
| |
`paramLists` name doesn't end in `ss`, so that sentence belongs to `paramss`. Also a few punctuation fixes.
|
|\ |
|
| |\
| | |
| | | |
Move ASM out of the repository [ci: last-only]
|
| | | |
|
| | |
| | |
| | |
| | | |
ij fix
|
|\| | |
|
| |/
| |
| |
| |
| |
| |
| |
| | |
Similarly to GenSeqLike.apply, GenSeqLike.updated can throw
IndexOutOfBoundsException.
For example, the following throws IndexOutOfBoundsException:
Vector.empty[String].updated(0, "foo")
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Previously, the flag caused any elidable to be elided.
This commit simply sets -Xelide-below to ASSERTION + 1.
The flag is useful because there's no mnemonic for specifying
the magic constant as an option argument. `-Xelide-below ASSERTION`
means asserts are enabled.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Value classes that appear in signatures of Java defined methods
should not be erased to the underlying type.
Before this change, we'd get a `ClassCastException`, as the Scala
call site would unbox the value class despite the fact the Java
recipient would expect the boxed representation.
I've tested this for primitive and object wrapped types in parameter
and return position.
|
| |\
| | |
| | | |
Remove references to the old PDF version of the specification
|
| | | |
|
| |\ \
| | | |
| | | | |
SI-8679 Add support for ScalaLongSignature attribute in scalap
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
scalap didn't support really big class files. It was returning an
empty String for such files. The reason was that there were only
ScalaSignatures taken into account.
This commit adds support for ScalaLongSignature. We try to get such
an attribute when we didn't find ScalaSignature. Also there's added
an additional case to the logic retrieving bytes for a signature.
Since ScalaLongSignature can contain many parts, we have to merge
their byte arrays.
Changes are tested by a new partest-based test. These two files are
really big, but it was required (t8679.scala is a reduced version of
BigScalaClass - an example attached to JIRA).
There are also added TODOs with a JIRA ticket: We have three places,
where we process Scala signatures. In the future it would be better to
reuse some common logic, if it's possible.
|
| |\ \ \
| | | | |
| | | | | |
Fix scaladoc of Try#failed
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
The documentation stated that it returns a Success[Throwable] regardless, either containing the failure or an UnsupportedOperationException. However only Failure#failed returns a success; Success#failed returns a Failure.
Also the phrasing of "Completes this `Try`" and "that `Try` failed with" sounds like it was copy-pasted from Future? Trys don't complete, nor fail, they are immutable.
|
| |\ \ \ \
| | | | | |
| | | | | | |
Use LambdaMetafactory where possible for lambda creation.
|
| | | | | | |
|
| | | | | | |
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
```
scala> (x: Int) => {??? : Int}
res2: Int => Int = $$Lambda$1371/1961176822@6ed3ccb2
scala> res2(42)
scala.NotImplementedError: an implementation is missing
at scala.Predef$.$qmark$qmark$qmark(Predef.scala:225)
at .$anonfun$1(<console>:8)
at $$Lambda$1371/1961176822.apply$mcII$sp(Unknown Source)
... 33 elided
scala> (x: Int, y: Long) => {??? : Int}
res4: (Int, Long) => Int = $$Lambda$1382/1796047085@6f8e8894
scala> res4(0, 0L)
scala.NotImplementedError: an implementation is missing
at scala.Predef$.$qmark$qmark$qmark(Predef.scala:225)
at .$anonfun$1(<console>:8)
at $$Lambda$1382/1796047085.apply$mcIIJ$sp(Unknown Source)
... 33 elided
```
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Suitable lambdas are identified in Delambdafy and marked with
such with a tree annotation that includes the
data needed by the backend to emit an invokedynamic instruction.
GenBCode to rewrite instantiation of such anonymous
function classes with an invokedynamic instruction. At this
stage, I don't plan to merge the support for this into GenASM.
Between these points, the lambda capture is represented as an
application of a dummy factory symbol:
```
<dummy>(captures...) : FunctionN
```
Demo:
```
% wget http://central.maven.org/maven2/org/scala-lang/modules/scala-java8-compat_2.11/0.3.0/scala-java8-compat_2.11-0.3.0.jar
% qscala -classpath scala-java8-compat_2.11-0.3.0.jar -Ydelambdafy:method -target:jvm-1.8 -Ybackend:GenBCode
Welcome to Scala version 2.11.6-20150309-144147-c91c978c81 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_25).
Type in expressions to have them evaluated.
Type :help for more information.
scala> (() => "").getClass
res0: Class[_ <: () => String] = class $$Lambda$1/871790326
```
I have also corrected an error in a previous commit. The newly added
symbol test, `isDelambdafyTarget`, needs to check for the `ARTIFACT`
flag, as that is what is added to the method by `Uncurry`.
|
| |\ \ \ \ \
| | | | | | |
| | | | | | | |
Fix documentation of assertions in Predef
|
| | | |_|/ /
| | |/| | |
| | | | | | |
Assertions can be elided at compile time; they generate no runtime conditional code and are in fact run unconditionally if not elided during compilation. Updated documentation to reflect that.
|
| |\ \ \ \ \
| | | | | | |
| | | | | | | |
SI-9282 Avoid obscuring an exception during classfile parsing
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Based on analysis of a stack trace in this bug report, I identified
a code path in `ClassfileParser` that can lead to an NPE in its
exception handling code. If `val in = new AbstractFileReader(file)`
throws (e.g during its construction in which it eagerly reads the
file `val buf: Array[Byte] = file.toByteArray`), the call to
`in.file` in `handleError` will NPE.
This commit stores the active file directly a field in ClassfileParser
and uses this in the error reporting.
|
| |\ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
SI-9285 Don't warn about non-sensible equals in synthetic methods
|
| | | |/ / / /
| | |/| | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Notably, in the synthetic equals method of a case class. Otherwise,
we get an unsuppressable warning when defining a case class with a
`Unit`-typed parameter, which some folks use a placeholder for
real type while evolving a design.
|
| |\ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
Remove unused, mostly commented out doc/html/page/Source.scala
|
| | |/ / / / /
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
This file seems to be some early, unfinished draft. It's unused and
mostly commented out. De facto it hasn't been changed since this
version:
https://github.com/scala/scala/blob/d9e3dde6d6d18b9a93e7566447cc3ee342f033d5/src/compiler/scala/tools/nsc/doc/html/page/Source.scala
Just in meantime someone updated imports, moved it to other package
etc. but nothing more.
|
| |\ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
Cleanup files in wrong place
|
| | | | | | | | |
|
| | |/ / / / / |
|
| |/ / / / /
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Removes the src/intellij-14 folder and moves everything back to
src/intellij.
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
Merge 2.11.x to 2.12.x [ci: last-only]
|
| |\| | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
merge/2.11.x-to-2.12.x-20150501
|
| | |\ \ \ \ \
| | | |_|_|/ /
| | |/| | | | |
SI-9279 Improve performance of bash runner script
|
| | | |/ / /
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
In fbe897d16, the template for bash scripts (scala/scalac/etc) was
modified to fix processing of `-J`, `-bootcp`.
This involved looping through the argument array and filtering out
options like `-bootcp` that only influence the script, and shouldn't
be passed to the JVM.
However, the mechanism to do this uses an inefficient, erm,
"CanBuildFrom", and under the load of even a few hundred source
files takes half a second before the JVM starts. Throw 2000 files
at it, and you have to wait ten seconds!
This commit uses a more efficient array append operator. This requires
Bash 3 or above. Hopefully it is safe to presume this version these
days, it's been around for a decade.
Results:
```
% time ~/scala/2.11.6/bin/scalac -J-NOJVM abcdedfghijklmnopqrtsuvwxyv{1..2000} 2>&1
Unrecognized option: -NOJVM
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
real 0m7.765s
user 0m7.734s
sys 0m0.028s
% time ./build/quick/bin/scalac -J-NOJVM abcdedfghijklmnopqrtsuvwxyv{1..2000} 2>&1
Unrecognized option: -NOJVM
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
real 0m0.144s
user 0m0.124s
sys 0m0.022s
```
Thanks to Stephan Schmidt for pointing out the performance gulf.
|
| | |\ \ \ \
| | | | | | |
| | | | | | | |
SI-9254 UnrolledBuffer appends in wrong position
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Fixed two bugs in insertion (insertAll of Unrolled):
1. Incorrect recursion leading to an inability to insert past the first chunk
2. Incorect repositioning of `lastptr` leading to strange `append` behavior after early insertion
Added tests checking that both of these things now work.
Also added a comment that "waterlineDelim" is misnamed. But we can't fix it now--it's part of the public API. (Shouldn't be, but it is.)
|
| | |\ \ \ \ \
| | | | | | | |
| | | | | | | | |
SI-9197 Duration.Inf not a singleton when deserialized
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
Made `Duration.Undefined`, `.Inf`, and `.MinusInf` all give back the singleton instance instead of creating a new copy by overriding readResolve.
This override can be (and is) private, which at least on Sun's JDK8 doesn't mess with the auto-generated SerialVersionUIDs.
Thus, the patch should make things strictly better: if you're on 2.11.7+ on JVMs which pick the same SerialVersionUIDs, you can recover singletons. Everywhere else you were already in trouble anyway.
|
| | |\ \ \ \ \ \
| | | | | | | | |
| | | | | | | | | |
SI-9275 Fix row-first display in REPL
|
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
A missing range check in case anyone ever wants to use
```
-Dscala.repl.format=across
```
which was observed only because of competition from Ammonite.
|
| | |\ \ \ \ \ \ \
| | | | | | | | | |
| | | | | | | | | | |
Fix many typos
|
| | | |/ / / / / /
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
This commit corrects many typos found in scaladocs and comments.
There's also fixed the name of a private method in ICodeCheckers.
|
| | |\ \ \ \ \ \ \
| | | |_|_|_|/ / /
| | |/| | | | | | |
Don't crash GenBCode for value classes with a self declaration
|