| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| | |
SI-7601 Scaladoc: img elements must have an "alt" attribute
|
| |
| |
| |
| | |
This change makes Scaladoc's HTML valid a bit.
|
|\ \
| | |
| | | |
SI-9173 Either extends Product with Serializable
|
| | | |
|
|\ \ \
| | | |
| | | | |
SI-9174 Try extends Product with Serializable
|
| | |/
| |/| |
|
|\ \ \
| |/ /
|/| | |
SI-9200 Fix Java generic signatures for refined types
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The erasure of a refined type `T1 with T2 ... Tn` is the
erasure of the intersection dominator of the elements.
In addition to erased method signatures, the compiler also emits
Java generic signatures, included information about generic types,
up to the point that it is possible to express in the language of
Java 5 generics.
Java generic signatures must be consistent with erasued signatures,
that is, the Java compiler must erase that generic signature to the
same erased signature. If this does not hold, linkage errors will
occur.
The compiler implements erasure in `ErasureMap` and java generic
signatures in `Erasure#javaSig`. Regrettably, these don't share
any implementation; e.g `javaSig` only takes the first parent of
a refinement type, rather than using `intersectionDominator`.
This commit fixes that discrepency.
|
|\ \ \
| | | |
| | | | |
SI-9074 Fix generic substitution with package objects, overloading
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Takes a leaf out of dotty's book [1] and makes `asSeenFrom`
transparently change the prefix from the package class to the
package object when needed.
This fixes generic subsitution during overload resolution, as
reported in SI-9074.
This subsumes the former fix for SI-6225, which is removed here.
[1] https://github.com/lampepfl/dotty/pull/282
|
|\ \ \ \
| |/ / /
|/| | | |
SI-9167 Clarify ScalaVersion parsing
|
| | |/
| |/|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Probably it was unintended to accept "2.." and "2.-11.7".
This commit makes it a bit more regular and also accepts arbitrary
text after the dash in the build string, including newlines.
Since the number parts must be numbers, accept only digits.
That also disallows "2.+11.7", which could be misconstrued as
some sort of range.
As before, the special build string prefixes "rc" and "m" are
case-insensitive, but "FINAL" is not.
|
|\ \ \
| | | |
| | | | |
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 <--
|
| | | | | |
|
| | | | | |
|