Skip to content

Commit 79e5101

Browse files
authored
Merge pull request scala#6280 from SethTisue/merge-2.12.x-to-2.13.x-20180124
Merge 2.12.x to 2.13.x [ci:last-only]
2 parents 629ceeb + aac0816 commit 79e5101

File tree

163 files changed

+2315
-615
lines changed

Some content is hidden

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

163 files changed

+2315
-615
lines changed

LICENSE

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
This software includes projects with other licenses -- see `doc/LICENSE.md`.
22

3-
Copyright (c) 2002-2017 EPFL
4-
Copyright (c) 2011-2017 Lightbend, Inc.
3+
Copyright (c) 2002-2018 EPFL
4+
Copyright (c) 2011-2018 Lightbend, Inc.
55

66
All rights reserved.
77

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,6 @@ codebase and re-compiles too many files, resulting in long build times (check
141141
meantime you can:
142142
- Enable "Ant mode" in which sbt only re-compiles source files that were modified.
143143
Create a file `local.sbt` containing the line `antStyle := true`.
144-
Add an entry `local.sbt` to your `~/.gitignore`.
145144
- Use IntelliJ IDEA for incremental compiles (see [IDE Setup](#ide-setup) below) - its
146145
incremental compiler is a bit less conservative, but usually correct.
147146

@@ -265,6 +264,10 @@ before the commit's PR has been merged. That commit is then used to
265264
build a large number of open-source projects from source and run their
266265
test suites.
267266

267+
To request a community build run on your PR, just ask in a comment on
268+
the PR and a Scala team member will take care of
269+
it. ([details](https://github.com/scala/community-builds/wiki#can-i-run-it-against-a-pull-request-in-scalascala))
270+
268271
Community builds run on the Scala Jenkins instance. The jobs are
269272
named `..-integrate-community-build`. See the
270273
[scala/community-builds](https://github.com/scala/community-builds)

doc/LICENSE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ Scala is licensed under the [BSD 3-Clause License](http://opensource.org/license
22

33
## Scala License
44

5-
Copyright (c) 2002-2017 EPFL
5+
Copyright (c) 2002-2018 EPFL
66

7-
Copyright (c) 2011-2017 Lightbend, Inc.
7+
Copyright (c) 2011-2018 Lightbend, Inc.
88

99
All rights reserved.
1010

doc/License.rtf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
\fs48 Scala License
1111
\fs40 \
1212

13-
\fs26 Copyright (c) 2002-2017 EPFL\
14-
Copyright (c) 2011-2017 Lightbend, Inc.\
13+
\fs26 Copyright (c) 2002-2018 EPFL\
14+
Copyright (c) 2011-2018 Lightbend, Inc.\
1515
All rights reserved.\
1616
\
1717
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\

project/VersionUtil.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ object VersionUtil {
2626
)
2727

2828
lazy val generatePropertiesFileSettings = Seq[Setting[_]](
29-
copyrightString := "Copyright 2002-2017, LAMP/EPFL and Lightbend, Inc.",
29+
copyrightString := "Copyright 2002-2018, LAMP/EPFL and Lightbend, Inc.",
3030
resourceGenerators in Compile += generateVersionPropertiesFile.map(file => Seq(file)).taskValue,
3131
generateVersionPropertiesFile := generateVersionPropertiesFileImpl.value
3232
)

spec/07-implicits.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ sort(yss)
155155
The call above will be completed by passing two nested implicit arguments:
156156

157157
```scala
158-
sort(yss)(xs: List[Int] => list2ordered[Int](xs)(int2ordered))
158+
sort(yss)((xs: List[Int]) => list2ordered[Int](xs)(int2ordered))
159159
```
160160

161161
The possibility of passing implicit arguments to implicit arguments

src/compiler/scala/tools/nsc/Global.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1347,7 +1347,7 @@ class Global(var currentSettings: Settings, var reporter: Reporter)
13471347
def compiles(sym: Symbol): Boolean =
13481348
if (sym == NoSymbol) false
13491349
else if (symSource.isDefinedAt(sym)) true
1350-
else if (!sym.isTopLevel) compiles(sym.enclosingTopLevelClassOrDummy)
1350+
else if (!sym.isTopLevel) compiles(sym.originalEnclosingTopLevelClassOrDummy)
13511351
else if (sym.isModuleClass) compiles(sym.sourceModule)
13521352
else false
13531353

src/compiler/scala/tools/nsc/ast/DocComments.scala

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,10 @@ trait DocComments { self: Global =>
7070
* the doc comment of the overridden version is copied instead.
7171
*/
7272
def cookedDocComment(sym: Symbol, docStr: String = ""): String = cookedDocComments.getOrElseUpdate(sym, {
73-
var ownComment = if (docStr.length == 0) docComments get sym map (_.template) getOrElse ""
74-
else DocComment(docStr).template
75-
ownComment = replaceInheritDocToInheritdoc(ownComment)
73+
val ownComment = replaceInheritDocToInheritdoc {
74+
if (docStr.length == 0) docComments get sym map (_.template) getOrElse ""
75+
else DocComment(docStr).template
76+
}
7677

7778
superComment(sym) match {
7879
case None =>
@@ -133,8 +134,12 @@ trait DocComments { self: Global =>
133134
mapFind(sym :: allInheritedOverriddenSymbols(sym))(docComments get _)
134135

135136
/** The cooked doc comment of an overridden symbol */
136-
protected def superComment(sym: Symbol): Option[String] =
137-
allInheritedOverriddenSymbols(sym).iterator map (x => cookedDocComment(x)) find (_ != "")
137+
protected def superComment(sym: Symbol): Option[String] = {
138+
val getter: Symbol = sym.getter
139+
allInheritedOverriddenSymbols(getter.orElse(sym)).iterator
140+
.map(cookedDocComment(_))
141+
.find(_ != "")
142+
}
138143

139144
private def mapFind[A, B](xs: Iterable[A])(f: A => Option[B]): Option[B] =
140145
xs collectFirst scala.Function.unlift(f)

src/compiler/scala/tools/nsc/ast/TreeGen.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ abstract class TreeGen extends scala.reflect.internal.TreeGen with TreeDSL {
351351
case mt @ MethodType(params, res) => copyMethodType(mt, selfParamSym :: params, res)
352352
})
353353
val selfParam = ValDef(selfParamSym)
354-
val rhs = orig.rhs.substituteThis(newSym.owner, gen.mkAttributedIdent(selfParamSym)) // SD-186 intentionally leaving Ident($this) is unpositioned
354+
val rhs = orig.rhs.substituteThis(newSym.owner, gen.mkAttributedIdent(selfParamSym)) // scala/scala-dev#186 intentionally leaving Ident($this) is unpositioned
355355
.substituteSymbols(origParams, newSym.info.params.drop(1)).changeOwner(origSym -> newSym)
356356
treeCopy.DefDef(orig, orig.mods, orig.name, orig.tparams, (selfParam :: orig.vparamss.head) :: Nil, orig.tpt, rhs).setSymbol(newSym)
357357
}

src/compiler/scala/tools/nsc/ast/parser/Parsers.scala

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2899,9 +2899,8 @@ self =>
28992899
val name = ident()
29002900
val tstart = in.offset
29012901
atPos(start, if (name == nme.ERROR) start else nameOffset) {
2902-
val mods1 = if (in.token == SUBTYPE) mods | Flags.DEFERRED else mods
2903-
val template = templateOpt(mods1, name, NoMods, Nil, tstart)
2904-
ModuleDef(mods1, name.toTermName, template)
2902+
val template = templateOpt(mods, name, NoMods, Nil, tstart)
2903+
ModuleDef(mods, name.toTermName, template)
29052904
}
29062905
}
29072906

@@ -3003,13 +3002,17 @@ self =>
30033002

30043003
/** {{{
30053004
* ClassTemplateOpt ::= `extends' ClassTemplate | [[`extends'] TemplateBody]
3006-
* TraitTemplateOpt ::= TraitExtends TraitTemplate | [[`extends'] TemplateBody] | `<:' TemplateBody
3007-
* TraitExtends ::= `extends' | `<:'
3005+
* TraitTemplateOpt ::= TraitExtends TraitTemplate | [[TraitExtends] TemplateBody]
3006+
* TraitExtends ::= `extends' | `<:' (deprecated)
30083007
* }}}
30093008
*/
30103009
def templateOpt(mods: Modifiers, name: Name, constrMods: Modifiers, vparamss: List[List[ValDef]], tstart: Offset): Template = {
3010+
def deprecatedUsage(): Boolean = {
3011+
deprecationWarning(in.offset, "Using `<:` for `extends` is deprecated", since = "2.12.5")
3012+
true
3013+
}
30113014
val (parents, self, body) = (
3012-
if (in.token == EXTENDS || in.token == SUBTYPE && mods.isTrait) {
3015+
if (in.token == EXTENDS || in.token == SUBTYPE && mods.isTrait && deprecatedUsage()) {
30133016
in.nextToken()
30143017
template()
30153018
}
@@ -3230,11 +3233,12 @@ self =>
32303233
* }}}
32313234
*/
32323235
def blockStatSeq(): List[Tree] = checkNoEscapingPlaceholders {
3236+
def acceptStatSepOptOrEndCase() = if (!isCaseDefEnd) acceptStatSepOpt()
32333237
val stats = new ListBuffer[Tree]
32343238
while (!isStatSeqEnd && !isCaseDefEnd) {
32353239
if (in.token == IMPORT) {
32363240
stats ++= importClause()
3237-
acceptStatSepOpt()
3241+
acceptStatSepOptOrEndCase()
32383242
}
32393243
else if (isDefIntro || isLocalModifier || isAnnotation) {
32403244
if (in.token == IMPLICIT) {
@@ -3244,11 +3248,11 @@ self =>
32443248
} else {
32453249
stats ++= localDef(0)
32463250
}
3247-
acceptStatSepOpt()
3251+
acceptStatSepOptOrEndCase()
32483252
}
32493253
else if (isExprIntro) {
32503254
stats += statement(InBlock)
3251-
if (!isCaseDefEnd) acceptStatSep()
3255+
acceptStatSepOptOrEndCase()
32523256
}
32533257
else if (isStatSep) {
32543258
in.nextToken()

0 commit comments

Comments
 (0)