summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* SI-9174 Try extends Product with SerializableSimon Ochsenreither2015-03-261-1/+1
|
* Merge pull request #4396 from retronym/ticket/9074-2.12Lukas Rytz2015-03-247-23/+48
|\ | | | | SI-9074 Fix generic substitution with package objects, overloading
| * SI-9074 Fix generic substitution with package objects, overloadingJason Zaugg2015-03-247-23/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Merge pull request #4352 from som-snytt/issue/9167-2.12Jason Zaugg2015-03-244-31/+65
|\ \ | |/ |/| SI-9167 Clarify ScalaVersion parsing
| * SI-9167 Clarify ScalaVersion parsingSom Snytt2015-02-204-31/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Merge pull request #4302 from som-snytt/issue/deprecate-named-paramLukas Rytz2015-03-236-71/+93
|\ \ | | | | | | SI-9140 Allow deprecating current parameter name
| * | SI-9140 Minor refactor for readabilitySom Snytt2015-02-091-58/+56
| | | | | | | | | | | | Make a couple of functions and use cases for if-else if-else etc.
| * | SI-9140 Allow omitting pleonastic parameter nameSom Snytt2015-02-095-26/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | SI-9140 Allow deprecating current parameter nameSom Snytt2015-02-084-30/+43
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 ```
* | Merge pull request #4301 from som-snytt/issue/8918-deferredLukas Rytz2015-03-232-5/+66
|\ \ | | | | | | SI-8918 Unary ids are plain ids
| * | SI-8918 Unary ids are plain idsSom Snytt2015-02-082-5/+66
| |/ | | | | | | | | | | | | | | 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.
* | Merge pull request #4300 from CodeMettle/FiniteDuration.toCoarsestLukas Rytz2015-03-232-2/+5
|\ \ | | | | | | Declare FiniteDuration.toCoarsest to return a FiniteDuration
| * | Declare FiniteDuration.toCoarsest to return a FiniteDurationSteven Scott2015-02-062-2/+5
| |/ | | | | | | | | | | | | | | 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.
* | Merge pull request #4372 from som-snytt/issue/7775-tweakLukas Rytz2015-03-235-6/+58
|\ \ | | | | | | SI-7775 Exclude nulls when iterating sys props
| * | SI-7775 Exclude nulls when iterating sys propsSom Snytt2015-03-025-6/+58
| |/ | | | | | | | | | | | | | | | | | | | | 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.
* | Merge pull request #4241 from kanielc/SI-6778Lukas Rytz2015-03-233-4/+11
|\ \ | | | | | | SI-6778 scala.math.random should have parenthesis
| * | SI-6778 scala.math.random should have parenthesisDenton Cockburn2015-01-103-4/+11
| | |
* | | Merge pull request #4368 from som-snytt/review/7784Lukas Rytz2015-03-233-2/+15
|\ \ \ | | | | | | | | SI-7784 Allow a singleton type over a constant value defn.
| * | | SI-7784 Extend test with enum constantSom Snytt2015-02-281-0/+4
| | | | | | | | | | | | | | | | Because we can.
| * | | SI-7784 Allow a singleton type over a constant value defn.Jason Zaugg2015-02-283-2/+11
|/ / / | | | | | | | | | | | | | | | 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.
* | | Merge pull request #4362 from ms-tg/SI-9134Adriaan Moors2015-02-261-0/+25
|\ \ \ | | | | | | | | SI-9134 Verify Stream#withFilter#map lazy in tail
| * | | SI-9134 Verify Stream#withFilter#map lazy in tailMarc Siegel2015-02-251-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | Merge pull request #4363 from retronym/topic/t8575-check-initJason Zaugg2015-02-261-3/+2
|\ \ \ \ | |/ / / |/| | | SI-8575 Avoid use of unitialized field in a test.
| * | | SI-8575 Avoid use of unitialized field in a test.Jason Zaugg2015-02-261-3/+2
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 ```
* | | Merge pull request #4284 from ms-tg/SI-8990-rebase-on-2.12-squashedAdriaan Moors2015-02-232-52/+92
|\ \ \ | | | | | | | | SI-8990 Fix lazy evaluation of StreamWithFilter#foreach
| * | | SI-8990 Allow GC during lazy evaluation of Stream#withFilterMarc Siegel2015-02-202-52/+92
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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
* | | Merge pull request #4343 from adriaanm/reword-4267Adriaan Moors2015-02-233-36/+334
|\ \ \ | | | | | | | | SI-9113 Converting `null` collection Java<->Scala yields `null`
| * | | SI-9113 Converting `null` collection Java<->Scala yields `null`Roman Hargrave2015-02-183-36/+334
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `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).
* | | Merge pull request #4323 from axel22/t-concurrent-map-get-2.12.xAdriaan Moors2015-02-232-0/+87
|\ \ \ | | | | | | | | Fix SI-9147 Override `getOrElseUpdate` in `concurrent.Map`.
| * | | Fix SI-9147 Override `getOrElseUpdate` in `concurrent.Map`.Aleksandar Prokopec2015-02-122-0/+87
| |/ / | | | | | | | | | Also, add a ScalaCheck test.
* | | Merge pull request #4286 from retronym/ticket/9131Adriaan Moors2015-02-233-18/+14
|\ \ \ | |/ / |/| | SI-9131 Fix use of apply syntactic sugar with by-name param
| * | SI-9131 Fix use of apply syntactic sugar with by-name paramJason Zaugg2015-02-033-18/+14
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Merge pull request #4287 from adriaanm/ci-2.12-ide-nopAdriaan Moors2015-02-021-0/+3
|\ \ | | | | | | Punt on IDE validation in 2.12.x
| * | Punt on IDE validation in 2.12.x...Adriaan Moors2015-02-021-0/+3
|/ / | | | | | | ... until https://github.com/scala-ide/uber-build/issues/48 is fixed.
* | Merge pull request #4272 from retronym/merge/2.11.x-to-2.12.x-20150129Jason Zaugg2015-02-02702-3421/+13507
|\ \ | | | | | | Merge 2.11.x to 2.12.x
| * | Refer to 2.12 in new release scriptsJason Zaugg2015-01-291-2/+2
| | |
| * | Merge remote-tracking branch 'origin/2.11.x' into ↵Jason Zaugg2015-01-29204-579/+3368
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | merge/2.11.x-to-2.12.x-20150129 Conflicts: build.number src/library/scala/concurrent/Future.scala versions.properties
| | * \ Merge pull request #4271 from retronym/ticket/8642Adriaan Moors2015-01-283-3/+28
| | |\ \ | | | | | | | | | | SI-8642 Enable OSGi tests under Java 8
| | | * | SI-8642 Enable OSGi tests under Java 8Jason Zaugg2015-01-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| | | * | Add an IntelliJ module for the Pax Exam based OSGi testsJason Zaugg2015-01-283-2/+27
| | |/ / | | | | | | | | | | | | We can now edit these in IntelliJ, as per the regular JUnit tests.
| | * | Merge pull request #4268 from adriaanm/new-ci-validationAdriaan Moors2015-01-285-71/+249
| | |\ \ | | | | | | | | | | IMPORTANT: Base your PR on this one --> New PR validation <--
| | | * | IDE validation: run on last commitAdriaan Moors2015-01-271-0/+32
| | | | |
| | | * | New PR validationAdriaan Moors2015-01-214-71/+217
| | | | |
| | * | | Merge pull request #4214 from som-snytt/issue/5154Jason Zaugg2015-01-222-4/+12
| | |\ \ \ | | | | | | | | | | | | SI-5154 Parse leading literal brace in XML pattern
| | | * | | SI-5154 Parse leading literal brace in XML patternSom Snytt2014-12-162-4/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't consume literal brace as Scala pattern. Previously, leading space would let the text parser `xText` handle it correctly instead.
| | * | | | Merge pull request #4190 from kanielc/SI-5817Jason Zaugg2015-01-222-0/+20
| | |\ \ \ \ | | | |_|/ / | | |/| | | SI-5817: Add header to language.scala and languageFeature.scala
| | | * | | SI-5817: Add header to language.scala and languageFeature.scalaDenton Cockburn2014-12-052-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| | * | | | Merge pull request #4253 from retronym/ticket/9087Grzegorz Kossakowski2015-01-203-8/+74
| | |\ \ \ \ | | | | | | | | | | | | | | SI-9087 Fix min/max of reversed Double/Float orderings
| | | * | | | SI-9087 Fix min/max of reversed Double/Float orderingsJason Zaugg2015-01-203-8/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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}`.
| | * | | | | Merge pull request #4247 from adriaanm/2.11.5-bumpGrzegorz Kossakowski2015-01-203-5/+10
| | |\ \ \ \ \ | | | | | | | | | | | | | | | | 2.11.5 bump