Skip to content

Commit fd526c7

Browse files
committed
Merge pull request scala#4578 from retronym/merge/2.11.x-to-2.12.x-20150624
Merge 2.11.x to 2.12.x
2 parents 71cfa37 + 1f7417c commit fd526c7

File tree

242 files changed

+3885
-1645
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

242 files changed

+3885
-1645
lines changed

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ source "https://rubygems.org"
44
gem "jekyll", "2.5.3"
55
gem "rouge"
66
# gem 's3_website'
7-
# gem 'redcarpet'
7+
gem "redcarpet", "3.2.3"

README.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,24 @@ If you need some help with your PR at any time, please feel free to @-mention an
1313

1414
| username | talk to me about... |
1515
--------------------------------------------------------------------------------------------------|----------------------------------------------------------------|---------------------------------------------------|
16-
<img src="https://avatars.githubusercontent.com/adriaanm" height="50px" title="Adriaan Moors"/> | [`@adriaanm`](https://github.com/adriaanm) | anything (type checker, pattern matcher, CI,...) |
17-
<img src="https://avatars.githubusercontent.com/gkossakowski" height="50px" title="Grzegorz Kossakowski"/> | [`@gkossakowski`](https://github.com/gkossakowski) | infrastructure, incremental compilation, back-end |
16+
<img src="https://avatars.githubusercontent.com/adriaanm" height="50px" title="Adriaan Moors"/> | [`@adriaanm`](https://github.com/adriaanm) | how we can help // type checker, pattern matcher, infrastructure |
17+
<img src="https://avatars.githubusercontent.com/SethTisue" height="50px" title="Seth Tisue"/> | [`@SethTisue`](https://github.com/SethTisue) | back-end, library, improving the *welcome to Scala* experience |
1818
<img src="https://avatars.githubusercontent.com/retronym" height="50px" title="Jason Zaugg"/> | [`@retronym`](https://github.com/retronym) | Java 8 lambdas, tricky bug detective work |
1919
<img src="https://avatars.githubusercontent.com/Ichoran" height="50px" title="Rex Kerr"/> | [`@Ichoran`](https://github.com/Ichoran) | the collections library, performance |
2020
<img src="https://avatars.githubusercontent.com/lrytz" height="50px" title="Lukas Rytz"/> | [`@lrytz`](https://github.com/lrytz) | optimizer, named & default arguments |
21-
<img src="https://avatars.githubusercontent.com/dickwall" height="50px" title="Dick Wall"/> | [`@dickwall`](https://github.com/dickwall) | process & documentation |
2221
<img src="https://avatars.githubusercontent.com/VladUreche" height="50px" title="Vlad Ureche"/> | [`@VladUreche`](https://github.com/VladUreche) | specialization & the scaladoc tool |
2322
<img src="https://avatars.githubusercontent.com/densh" height="50px" title="Denys Shabalin"/> | [`@densh`](https://github.com/densh) | quasiquotes, parser, string interpolators, macros in standard library |
2423
<img src="https://avatars.githubusercontent.com/xeno-by" height="50px" title="Eugene Burmako"/> | [`@xeno-by`](https://github.com/xeno-by) | macros and reflection |
24+
<img src="https://avatars.githubusercontent.com/dickwall" height="50px" title="Dick Wall"/> | [`@dickwall`](https://github.com/dickwall) | process & community |
2525

2626

2727
PS: If you have some spare time to help out around here, we would be delighted to add your name to this list!
2828

2929
# Handy Links
3030
- [A wealth of documentation](http://docs.scala-lang.org)
3131
- [Scala CI](https://scala-ci.typesafe.com/)
32-
- [Scala CI at EPFL](https://scala-webapps.epfl.ch/jenkins/)
3332
- [Download the latest nightly](http://www.scala-lang.org/files/archive/nightly/2.11.x/);
33+
- [(Deprecated) Scala CI at EPFL](https://scala-webapps.epfl.ch/jenkins/)
3434
- Scala mailing lists:
3535
- [Compiler and standard library development](https://groups.google.com/group/scala-internals)
3636
- [Users of Scala](https://groups.google.com/group/scala-user)
@@ -66,7 +66,7 @@ You'll need a Java SDK (6 or newer), Apache Ant (version 1.8.0 or above), and cu
6666

6767
## Git Hygiene
6868

69-
As git history is forever, we take great pride in the quality of the commits we merge into the repository. The title of your commit will be read hundreds (of thousands? :-)) of times, so it pays off to spend just a little bit more time to polish it, making it descriptive and concise. Please take a minute to read the advice [most projects agree on](https://github.com/erlang/otp/wiki/Writing-good-commit-messages), and stick to 50-60 characters for the first line, wrapping subsequent ones at 80 (at most).
69+
As git history is forever, we take great pride in the quality of the commits we merge into the repository. The title of your commit will be read hundreds (of thousands? :-)) of times, so it pays off to spend just a little bit more time to polish it, making it descriptive and concise. Please take a minute to read the advice [most projects agree on](https://github.com/erlang/otp/wiki/Writing-good-commit-messages), and stick to 72 or fewer characters for the first line, wrapping subsequent ones at 80 (at most).
7070

7171
When not sure how to formulate your commit message, imagine you're writing a bullet item for the next release notes, or describing what the commit does to the code base (use active verbs in the present tense). When your commit title is featured in the next release notes, it will be read by a lot of curious Scala users, looking for the latest improvements. Satisfy their thirst for information with as few words as possible! Also, a commit should convey clearly to your (future) fellow contributors what it does to the code base.
7272

@@ -91,6 +91,12 @@ To help you plan your contributions, we communicate our plans on a regular basis
9191

9292
Once you've gained some experience with the code base and the process, the logical next step is to offers reviews for others's contributions. The main goal of this whole process, in the end, is to ensure the health of the Scala project by improving the quality of the code base, the documentation, as well as this process itself. Thank you for doing your part!
9393

94+
## [Labels](https://github.com/scala/scala/labels)
95+
- `reviewed` automatically added by scabot when a comment prefixed with LGTM is posted
96+
- `welcome` reviewer / queue curator adds to welcome someone's first PR (for highlighting in the release notes)
97+
- `release-notes` reviewer / queue curator adds to make sure this PR is highlighted in the release notes
98+
- `on-hold` added when this PR should not yet be merged, even though CI is green
99+
94100
### Tips & Tricks
95101
Once the `publish-core` task has completed on a commit, you can try it out in sbt as follows:
96102

bincompat-forward.whitelist.conf

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,59 @@ filter {
416416
{
417417
matchName="scala.util.Random.scala$util$Random$$nextAlphaNum$1"
418418
problemName=MissingMethodProblem
419+
},
420+
// Nominally private but in practice JVM-visible methods for reworked scala.util.Sorting
421+
{
422+
matchName="scala.util.Sorting.scala$util$Sorting$$mergeSort$default$5"
423+
problemName=MissingMethodProblem
424+
},
425+
{
426+
matchName="scala.util.Sorting.scala$util$Sorting$$mergeSort$mBc$sp"
427+
problemName=MissingMethodProblem
428+
},
429+
{
430+
matchName="scala.util.Sorting.scala$util$Sorting$$mergeSort$mFc$sp"
431+
problemName=MissingMethodProblem
432+
},
433+
{
434+
matchName="scala.util.Sorting.scala$util$Sorting$$mergeSort$mJc$sp"
435+
problemName=MissingMethodProblem
436+
},
437+
{
438+
matchName="scala.util.Sorting.scala$util$Sorting$$mergeSort"
439+
problemName=MissingMethodProblem
440+
},
441+
{
442+
matchName="scala.util.Sorting.scala$util$Sorting$$mergeSort$mCc$sp"
443+
problemName=MissingMethodProblem
444+
},
445+
{
446+
matchName="scala.util.Sorting.scala$util$Sorting$$mergeSort$mSc$sp"
447+
problemName=MissingMethodProblem
448+
},
449+
{
450+
matchName="scala.util.Sorting.scala$util$Sorting$$insertionSort"
451+
problemName=MissingMethodProblem
452+
},
453+
{
454+
matchName="scala.util.Sorting.scala$util$Sorting$$mergeSort$mZc$sp"
455+
problemName=MissingMethodProblem
456+
},
457+
{
458+
matchName="scala.util.Sorting.scala$util$Sorting$$mergeSort$mDc$sp"
459+
problemName=MissingMethodProblem
460+
},
461+
{
462+
matchName="scala.util.Sorting.scala$util$Sorting$$mergeSort$mIc$sp"
463+
problemName=MissingMethodProblem
464+
},
465+
{
466+
matchName="scala.util.Sorting.scala$util$Sorting$$mergeSorted"
467+
problemName=MissingMethodProblem
468+
},
469+
{
470+
matchName="scala.util.Sorting.scala$util$Sorting$$booleanSort"
471+
problemName=MissingMethodProblem
419472
}
420473
]
421474
}

build.sbt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,14 @@ lazy val interactive = configureAsSubproject(project)
191191
.settings(disableDocsAndPublishingTasks: _*)
192192
.dependsOn(compiler)
193193

194+
// TODO: SI-9339 embed shaded copy of jline & its interface (see #4563)
194195
lazy val repl = configureAsSubproject(project)
195-
.settings(libraryDependencies += jlineDep)
196+
.settings(
197+
libraryDependencies += jlineDep,
198+
connectInput in run := true,
199+
outputStrategy in run := Some(StdoutOutput),
200+
run <<= (run in Compile).partialInput(" -usejavacp") // Automatically add this so that `repl/run` works without additional arguments.
201+
)
196202
.settings(disableDocsAndPublishingTasks: _*)
197203
.dependsOn(compiler)
198204

build.xml

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,10 @@ TODO:
275275
<dependency groupId="biz.aQute" artifactId="bnd" version="1.50.0"/>
276276
</artifact:dependencies>
277277

278+
<artifact:dependencies pathId="jarjar.classpath">
279+
<dependency groupId="com.googlecode.jarjar" artifactId="jarjar" version="1.3"/>
280+
</artifact:dependencies>
281+
278282
<!-- JUnit -->
279283
<property name="junit.version" value="4.11"/>
280284
<artifact:dependencies pathId="junit.classpath" filesetId="junit.fileset">
@@ -313,7 +317,7 @@ TODO:
313317

314318
<!-- scala-java8-compat, used by the experimental -target jvm-1.8 support. -->
315319
<if><isset property="scala-java8-compat.package"/><then>
316-
<property name="scala-java8-compat.version" value="0.2.0"/>
320+
<property name="scala-java8-compat.version" value="0.5.0"/>
317321
<property name="scala-java8-compat.binary.version" value="2.11"/>
318322
<artifact:dependencies pathId="scala-java8-compat.classpath" filesetId="scala-java8-compat.fileset">
319323
<dependency groupId="org.scala-lang.modules" artifactId="scala-java8-compat_${scala-java8-compat.binary.version}" version="${scala-java8-compat.version}">
@@ -657,7 +661,7 @@ TODO:
657661
<property name="partest-javaagent.description" value="Scala Compiler Testing Tool (compiler-specific java agent)"/>
658662

659663
<!-- projects without project-specific options: forkjoin, manual, bin, repl -->
660-
<for list="compiler,interactive,scaladoc,library,parser-combinators,partest,partest-extras,partest-javaagent,reflect,scalap,swing,xml" param="project">
664+
<for list="compiler,interactive,scaladoc,library,parser-combinators,partest,partest-extras,partest-javaagent,reflect,scalap,swing,xml,repl-jline" param="project">
661665
<sequential>
662666
<!-- description is mandatory -->
663667
<init-project-prop project="@{project}" name="package" default=""/> <!-- used by mvn-package, copy-bundle, make-bundle -->
@@ -755,6 +759,11 @@ TODO:
755759
<path id="quick.repl.build.path">
756760
<path refid="quick.compiler.build.path"/>
757761
<pathelement location="${build-quick.dir}/classes/repl"/>
762+
</path>
763+
764+
<path id="quick.repl-jline.build.path">
765+
<path refid="quick.repl.build.path"/>
766+
<pathelement location="${build-quick.dir}/classes/repl-jline"/>
758767
<path refid="repl.deps.classpath"/>
759768
</path>
760769

@@ -829,6 +838,8 @@ TODO:
829838
<fileset refid="scala-java8-compat.fileset"/>
830839
</path>
831840

841+
<path id="pack.repl-jline.files"> <fileset dir="${build-quick.dir}/classes/repl-jline"/> </path>
842+
832843
<path id="pack.compiler.files">
833844
<fileset dir="${build-quick.dir}/classes/compiler"/>
834845

@@ -1028,6 +1039,7 @@ TODO:
10281039
</patternset>
10291040

10301041
<taskdef resource="scala/tools/ant/sabbus/antlib.xml" classpathref="starr.compiler.path"/>
1042+
<taskdef name="jarjar" classname="com.tonicsystems.jarjar.JarJarTask" classpathref="jarjar.classpath" />
10311043
</target>
10321044

10331045
<!-- ===========================================================================
@@ -1109,7 +1121,31 @@ TODO:
11091121
<staged-build with="locker" stage="quick" project="compiler"/> </target>
11101122

11111123
<target name="quick.repl" depends="quick.comp">
1112-
<staged-build with="locker" stage="quick" project="repl"/> </target>
1124+
<staged-build with="locker" stage="quick" project="repl"/>
1125+
<staged-build with="locker" stage="quick" project="repl-jline"/>
1126+
1127+
<staged-pack project="repl-jline"/>
1128+
1129+
<!-- make jline_embedded jar with classes of repl-jline and jline, then shade-->
1130+
<jarjar jarfile="${build-pack.dir}/${repl-jline.targetdir}/scala-repl-jline-embedded.jar" whenmanifestonly="fail">
1131+
<zipfileset src="${jline:jline:jar}"/>
1132+
<zipfileset src="${build-pack.dir}/${repl-jline.targetdir}/${repl-jline.targetjar}"/>
1133+
1134+
<rule pattern="org.fusesource.**" result="scala.tools.fusesource_embedded.@1"/>
1135+
<rule pattern="jline.**" result="scala.tools.jline_embedded.@1"/>
1136+
<rule pattern="scala.tools.nsc.interpreter.jline.**" result="scala.tools.nsc.interpreter.jline_embedded.@1"/>
1137+
<keep pattern="scala.tools.**"/>
1138+
</jarjar>
1139+
1140+
<!-- unzip jar to repl's class dir to obtain
1141+
- standard repl-jline
1142+
- a shaded repl-jline (scala/tools/nsc/interpreter/jline_embedded) & jline (scala.tools.jline_embedded)
1143+
-->
1144+
<copy todir="${build-quick.dir}/classes/repl">
1145+
<zipfileset src="${build-pack.dir}/${repl-jline.targetdir}/${repl-jline.targetjar}"/>
1146+
<zipfileset src="${build-pack.dir}/${repl-jline.targetdir}/scala-repl-jline-embedded.jar"/>
1147+
</copy>
1148+
</target>
11131149

11141150
<target name="quick.scaladoc" depends="quick.comp">
11151151
<staged-build with="locker" stage="quick" project="scaladoc" version="scaladoc"/> </target>

spec/04-basic-declarations-and-definitions.md

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ the sequence of variable definitions
298298
```ebnf
299299
Dcl ::= ‘type’ {nl} TypeDcl
300300
TypeDcl ::= id [TypeParamClause] [‘>:’ Type] [‘<:’ Type]
301-
Def ::= type {nl} TypeDef
301+
Def ::= type {nl} TypeDef
302302
TypeDef ::= id [TypeParamClause] ‘=’ Type
303303
```
304304

@@ -620,7 +620,11 @@ well as the function body, if it is present.
620620

621621
A value parameter clause $\mathit{ps}$ consists of zero or more formal
622622
parameter bindings such as `$x$: $T$` or `$x: T = e$`, which bind value
623-
parameters and associate them with their types. Each value parameter
623+
parameters and associate them with their types.
624+
625+
### Default Arguments
626+
627+
Each value parameter
624628
declaration may optionally define a default argument. The default argument
625629
expression $e$ is type-checked with an expected type $T'$ obtained
626630
by replacing all occurences of the function's type parameters in $T$ by
@@ -632,13 +636,7 @@ expression. Here, $n$ denotes the parameter's position in the method
632636
declaration. These methods are parametrized by the type parameter clause
633637
`[$\mathit{tps}\,$]` and all value parameter clauses
634638
`($\mathit{ps}_1$)$\ldots$($\mathit{ps}_{i-1}$)` preceding $p_{i,j}$.
635-
The `$f\$$default$\$$n` methods are inaccessible for
636-
user programs.
637-
638-
The scope of a formal value parameter name $x$ comprises all subsequent
639-
parameter clauses, as well as the method return type and the function body, if
640-
they are given. Both type parameter names and value parameter names must
641-
be pairwise distinct.
639+
The `$f\$$default$\$$n` methods are inaccessible for user programs.
642640

643641
###### Example
644642
In the method
@@ -657,6 +655,20 @@ def compare$\$$default$\$$1[T]: Int = 0
657655
def compare$\$$default$\$$2[T](a: T): T = a
658656
```
659657

658+
The scope of a formal value parameter name $x$ comprises all subsequent
659+
parameter clauses, as well as the method return type and the function body, if
660+
they are given. Both type parameter names and value parameter names must
661+
be pairwise distinct.
662+
663+
A default value which depends on earlier parameters uses the actual arguments
664+
if they are provided, not the default arguments.
665+
666+
```scala
667+
def f(a: Int = 0)(b: Int = a + 1) = b // OK
668+
// def f(a: Int = 0, b: Int = a + 1) // "error: not found: value a"
669+
f(10)() // returns 11 (not 1)
670+
```
671+
660672
### By-Name Parameters
661673

662674
```ebnf

0 commit comments

Comments
 (0)