| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| | |
SI-9140 Allow deprecating current parameter name
|
| |
| |
| |
| | |
Make a couple of functions and use cases for if-else if-else etc.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Enable simply:
```
scala> def f(@deprecatedName foo: String) = foo.reverse
f: (foo: String)String
scala> f(foo = "bar")
<console>:9: warning: naming parameter foo has been deprecated.
f(foo = "bar")
^
res0: String = rab
```
`Symbol.deprecatedParamName` conventionally returns `NO_NAME`
when the name is omitted.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Allow deprecatedName to specify the name of the parameter
it qualifies.
This tells the user, That's my name, don't wear it out.
I.e., don't use my name when calling me.
Use cases include: the name will change; normally a name
should be provided for a boolean, but not in this case
(perhaps because there is only one argument).
```
scala> def f(@deprecatedName('foo) bar: String) = bar.reverse
f: (bar: String)String
scala> f(foo = "hello")
<console>:9: warning: the parameter name foo has been deprecated. Use bar instead.
f(foo = "hello")
^
res0: String = olleh
scala> def g(@deprecatedName('foo) foo: String) = foo.reverse
g: (foo: String)String
scala> g(foo = "hello")
<console>:9: warning: naming parameter foo has been deprecated.
g(foo = "hello")
^
res1: String = olleh
```
|
|\ \
| | |
| | | |
SI-8918 Unary ids are plain ids
|
| |/
| |
| |
| |
| |
| |
| |
| | |
Allow +,-,!,~ to be used as unprefixed identifiers.
As prefix operators, they must be followed by
a simple expression, so otherwise, consume the
id itself as the start of a simple expression.
|
|\ \
| | |
| | | |
Declare FiniteDuration.toCoarsest to return a FiniteDuration
|
| |/
| |
| |
| |
| |
| |
| |
| | |
FiniteDuration.toCoarsest is declared with a return type of Duration
even though it can only ever return a FiniteDuration. Change the
declaration to return a FiniteDuration so that using this method
doesn't require a cast or pattern match on the result in cases where
a FiniteDuration is required.
|
|\ \
| | |
| | | |
SI-7775 Exclude nulls when iterating sys props
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The previous fix to deal with concurrent modification of system
properties doesn't handle null results introduced when a property
is removed.
This commit filters nulls for safety, and also adds a `names`
method to `sys.SystemProperties`.
The test is upgraded.
|
|\ \
| | |
| | | |
SI-6778 scala.math.random should have parenthesis
|
| | | |
|
|\ \ \
| | | |
| | | | |
SI-7784 Allow a singleton type over a constant value defn.
|
| | | |
| | | |
| | | |
| | | | |
Because we can.
|
|/ / /
| | |
| | |
| | |
| | |
| | | |
When typechecking a `SingletonTypeTree`, we must `deconst`
the type of the typechecked reference tree to avoid collapsing
`a.type` into a constant type if `a` is a constant value definition.
|
|\ \ \
| | | |
| | | | |
SI-9134 Verify Stream#withFilter#map lazy in tail
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
As discussed in comments on [the issue](https://issues.scala-lang.org/browse/SI-9134),
it appears that the fix for SI-8990 also fixed this issue.
These tests demonstrate that it is fixed and will serve
as regression tests. Also, if back-ported to 2.11.x, they
could drive a potentially different fix there.
Squashed:
- incorporate review comments from adriaanm
|
|\ \ \ \
| |/ / /
|/| | | |
SI-8575 Avoid use of unitialized field in a test.
|
|/ / /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The checkinit build has been failing in the 2.12.x branch.
This commit modifies the errant test case to avoid using an
unitialized field.
I have verified that the new test still faithfully demonstrates the
original bug.
```
% scalac-hash v2.11.0 test/files/run/t8575.scala && scala-hash v2.11.0 Test
java.lang.AbstractMethodError: Test$.consume(Ljava/lang/Object;)V
```
|
|\ \ \
| | | |
| | | | |
SI-8990 Fix lazy evaluation of StreamWithFilter#foreach
|
| | |/
| |/|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
- The fact that StreamWithFilter was an inner class prevented
collection of the head during processing after #withFilter,
due to the reference to the outer class instance held in self.
- By implementing StreamWithFilter outside of the Stream class,
we gain control of the reference to the original Stream.
- We clarify explicit "filter after first use" semantics for the
reference to the original stream, which allows it to be GC'd
during the processing of foreach, map, and flatMap.
- Code is more DRY by implementing in terms of Stream#filter,
which is already correctly lazy, and then Stream's #map,
#flatMap, and #foreach, which already correctly allow GC.
- Unfortunately, the type returned by Stream#withFilter *must*
change, as it had previously inherited from the inner class
TraversableLike#WithFilter, which is where the problematic
reference to the outer class instance was held. Therefore,
this change is targetted to 2.12.x. There doesn't appear to
be any way to fix this without changing the type, sadly.
- Special thanks to @paulp who suggested the likely cause of the
issue at nescala 2015, and got me setup to build and run tests.
Also thanks to @Ichoran and @retronym, who suggested that
filter-after-first-use would preserve the reusable nature
of the return value from #withFilter, rather than a single-shot
null-after-first-use solution.
Review by @Ichoran and @retronym
Fixes #8990
|
|\ \ \
| | | |
| | | | |
SI-9113 Converting `null` collection Java<->Scala yields `null`
|
| |/ /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
`scala.collection.{JavaConversions, JavaConverters}` no longer wrap
a `null` collection, but return `null` instead. Before, a wrapper would
hold the original `null` collections, delaying the NPE until the first
operation on the collection was called, with no way of knowing whether we
were holding such a time bomb wrapper until the NPE was thrown.
For example, this now holds: `(null : java.util.Iterator[_]).asScala ==
null`. Before, a wrapper would silently be created that would NPE on any
further interaction.
An example of this issue in the wild can be seen at
https://github.com/scalafx/scalafx/issues/178, and an example of code
that generates such a wrapper [before the issue was fixed](https://github.com/scalafx/scalafx/blob/ad60d5faee687b71d3c0474510d
3f3dd081ea351/scalafx/src/main/scala/scalafx/stage/FileChooser.scala#L138).
|
|\ \ \
| | | |
| | | | |
Fix SI-9147 Override `getOrElseUpdate` in `concurrent.Map`.
|
| |/ /
| | |
| | |
| | | |
Also, add a ScalaCheck test.
|
|\ \ \
| |/ /
|/| | |
SI-9131 Fix use of apply syntactic sugar with by-name param
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
After typechecking a tree, the typer adapts it to the current
mode and expected type. If we are in FUNmode (typechecking the
qualifier of a value- or type-application), and the tree does not
already have a MethodType or PolyType, it is reinterepreted as
`qual.apply`.
In doing so, `insertApply` stabilizes the type of `qual`, e.g.
replacing `Ident(foo).setType(typeOf[Int])` with
`Ident(foo).setType(typeOf[foo.type])`.
However, this does not check for by-name parameters, which cannot
form the basis for a singleton type, as we can see by trying that
directly:
```
scala> def foo(a: => String) { type T = a.type }
<console>:7: error: stable identifier required, but a.type found.
def foo(a: => String) { type T = a.type }
^
```
When I last touched this code in SI-6206 / 267650cf9, I noted:
// TODO reconcile the overlap between Typers#stablize and TreeGen.stabilize
I didn't get around to that, but Adriaan gave that code a thorough
cleanup in fada1ef6b.
It appears that on the back of his work, we can now remove the local
stabilization logic in `insertApply` in favour of `TreeGen.stabilize`.
We then avoid the ill-formed singleton type, and the spurious
"apply is not a member" type error.
I did have to modify `isStableIdent` to check the symbol's info
in addition to the tree's type for by-name-ness.
|
|\ \
| | |
| | | |
Punt on IDE validation in 2.12.x
|
|/ /
| |
| |
| | |
... until https://github.com/scala-ide/uber-build/issues/48 is fixed.
|
|\ \
| | |
| | | |
Merge 2.11.x to 2.12.x
|
| | | |
|
| |\ \
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
merge/2.11.x-to-2.12.x-20150129
Conflicts:
build.number
src/library/scala/concurrent/Future.scala
versions.properties
|
| | |\ \
| | | | |
| | | | | |
SI-8642 Enable OSGi tests under Java 8
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
We use the PAX Exam framework to integration test that the
OSGi metadata we add to our JARs allows them to be loaded
into the Felix and Equinox containers. However, we had to
disable this test under Java 8 due to an incompatibility between
that framework and the modern Java version.
I have found a combination that works in Java 6, 7, and 8,
so the test is now run under all Java versions.
I have left a `skip` property to disable them, following the
established convention.
Tip of the hat to:
- @soc / @rkrzewski for the work in #4066 that paved the way
for this small change
- Harald Wellman, for sharing [1] the Java 8 compatible combination
of PAX and Felix .
Testing:
```
for V in 1.6 1.7 1.8; do java_use $V; ant -q test.osgi; done
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-466.1-11M4716)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-466.1, mixed mode)
...
[echo] Running OSGi JUnit tests. Output in /Users/jason/code/scala3/build/osgi
[echo] Test pass 1 of 2 using Apache Felix 4.4.0
[echo] Test pass 2 of 2 using Eclipse Equinox 3.7.1
BUILD SUCCESSFUL
Total time: 31 seconds
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)
...
[echo] Running OSGi JUnit tests. Output in /Users/jason/code/scala3/build/osgi
[echo] Test pass 1 of 2 using Apache Felix 4.4.0
[echo] Test pass 2 of 2 using Eclipse Equinox 3.7.1
BUILD SUCCESSFUL
Total time: 22 seconds
java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)
...
[echo] Running OSGi JUnit tests. Output in /Users/jason/code/scala3/build/osgi
[echo] Test pass 1 of 2 using Apache Felix 4.4.0
[echo] Test pass 2 of 2 using Eclipse Equinox 3.7.1
BUILD SUCCESSFUL
Total time: 16 seconds
```
[1] https://groups.google.com/d/msg/ops4j/TN0sZFf6wLs/vUP0GML6-TQJ
|
| | |/ /
| | | |
| | | |
| | | | |
We can now edit these in IntelliJ, as per the regular JUnit tests.
|
| | |\ \
| | | | |
| | | | | |
IMPORTANT: Base your PR on this one --> New PR validation <--
|
| | | | | |
|
| | | | | |
|
| | |\ \ \
| | | | | |
| | | | | | |
SI-5154 Parse leading literal brace in XML pattern
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Don't consume literal brace as Scala pattern.
Previously, leading space would let the text parser `xText`
handle it correctly instead.
|
| | |\ \ \ \
| | | |_|/ /
| | |/| | | |
SI-5817: Add header to language.scala and languageFeature.scala
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
These two files were missing headers.
There is other work on-going to automate updating of the headers, but
that likely won't crossover with this.
|
| | |\ \ \ \
| | | | | | |
| | | | | | | |
SI-9087 Fix min/max of reversed Double/Float orderings
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
As diagnosed by the reporter, we needed additional overrides
due to the way these orderings are implemented.
I've added tests to show other methods and other orderings
are working correctly.
After writing that, I found a scalacheck test related to
NaN handling that also covers `Ordering`. I had to correct
the assertion in the tests of `reverse.{min,max}`.
|
| | |\ \ \ \ \
| | | | | | | |
| | | | | | | | |
2.11.5 bump
|
| | | | | | | | |
|
| | | | | | | | |
|
| | |\ \ \ \ \ \
| | | | | | | | |
| | | | | | | | | |
Construct ClassBTypes from parsed classfiles
|
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
- Rename CodeRepository to ByteCodeRepository
- Scaladoc on OptimizerReporting
- Scaladoc on ByteCodeRepository
|
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
This infrastructure is required for the inliner: when inlining code
from a classfile, the corresponding ClassBType is needed for various
things (eg access checks, InnerClass attribute).
The test creates two ClassBTypes for the same class: once using the
(unpickled) Symbol, once using the parsed ASM ClassNode, and verifies
that the two are the same.
There's a cleanup to the InnerClass attribute:
object T { class Member; def foo = { class Local } }
class T
For Java compatibility the InnerClass entry for Member says the class
is nested in T (not in the module class T$). We now make sure to add
that entry only to T, not to T$ (unless Member is actually referenced
in the classfile T$, in that case it will be added, as required).
|