diff options
-rw-r--r-- | src/compiler/scala/tools/nsc/ast/parser/Parsers.scala | 16 | ||||
-rw-r--r-- | src/eclipse/README.md | 7 | ||||
-rw-r--r-- | src/library/scala/concurrent/Future.scala | 2 | ||||
-rw-r--r-- | test/files/neg/t7605-deprecation.check | 15 | ||||
-rw-r--r-- | test/files/neg/t7605-deprecation.scala | 7 |
5 files changed, 28 insertions, 19 deletions
diff --git a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala index cd1869340a..ef4052d5f3 100644 --- a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala +++ b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala @@ -2530,11 +2530,7 @@ self => val vparamss = paramClauses(nme.CONSTRUCTOR, classContextBounds map (_.duplicate), ofCaseClass = false) newLineOptWhenFollowedBy(LBRACE) val rhs = in.token match { - case LBRACE => { - if (settings.future) - deprecationWarning(in.offset, "Procedure syntax is deprecated. Convert procedure to method by adding `: Unit =`.") - atPos(in.offset) { constrBlock(vparamss) } - } + case LBRACE => atPos(in.offset) { constrBlock(vparamss) } case _ => accept(EQUALS) ; atPos(in.offset) { constrExpr(vparamss) } } DefDef(mods, nme.CONSTRUCTOR, List(), vparamss, TypeTree(), rhs) @@ -2560,14 +2556,16 @@ self => var restype = fromWithinReturnType(typedOpt()) val rhs = if (isStatSep || in.token == RBRACE) { - if (settings.future) - deprecationWarning(in.lastOffset, "Procedure syntax is deprecated. Convert procedure to method by adding `: Unit`.") - if (restype.isEmpty) restype = scalaUnitConstr + if (restype.isEmpty) { + if (settings.future) + deprecationWarning(in.lastOffset, s"Procedure syntax is deprecated. Convert procedure `$name` to method by adding `: Unit`.") + restype = scalaUnitConstr + } newmods |= Flags.DEFERRED EmptyTree } else if (restype.isEmpty && in.token == LBRACE) { if (settings.future) - deprecationWarning(in.offset, "Procedure syntax is deprecated. Convert procedure to method by adding `: Unit =`.") + deprecationWarning(in.offset, s"Procedure syntax is deprecated. Convert procedure `$name` to method by adding `: Unit =`.") restype = scalaUnitConstr blockExpr() } else { diff --git a/src/eclipse/README.md b/src/eclipse/README.md index d23e10ca1c..5311651db5 100644 --- a/src/eclipse/README.md +++ b/src/eclipse/README.md @@ -70,7 +70,12 @@ and Eclipse .classpath of the different projects isn’t updated accordingly. Th the build path of each project and make sure the version of the declared dependencies is in sync with the version declared in the `version.properties` file. If it isn’t, update it manually and, when done, don’t forget to share your changes via a pull request. -(We are aware this is manual process is cumbersome. If you feel like scripting this process, pull requests are of course welcome.) +(We are aware this is cumbersome. If you feel like scripting the process, pull requests are of course welcome.) + +Launching & Debugging scalac +============================ + +Read [here](http://scala-ide.org/docs/tutorials/scalac-trunk/index.html#Launching_and_Debugging_scalac). DETAILS ======= diff --git a/src/library/scala/concurrent/Future.scala b/src/library/scala/concurrent/Future.scala index dd86af0dd4..f905785bd6 100644 --- a/src/library/scala/concurrent/Future.scala +++ b/src/library/scala/concurrent/Future.scala @@ -488,7 +488,7 @@ object Future { */ def apply[T](body: =>T)(implicit @deprecatedName('execctx) executor: ExecutionContext): Future[T] = impl.Future(body) - /** Simple version of `Futures.traverse`. Transforms a `TraversableOnce[Future[A]]` into a `Future[TraversableOnce[A]]`. + /** Simple version of `Future.traverse`. Transforms a `TraversableOnce[Future[A]]` into a `Future[TraversableOnce[A]]`. * Useful for reducing many `Future`s into a single `Future`. */ def sequence[A, M[_] <: TraversableOnce[_]](in: M[Future[A]])(implicit cbf: CanBuildFrom[M[Future[A]], A, M[A]], executor: ExecutionContext): Future[M[A]] = { diff --git a/test/files/neg/t7605-deprecation.check b/test/files/neg/t7605-deprecation.check index 9c466c058c..6db94613a1 100644 --- a/test/files/neg/t7605-deprecation.check +++ b/test/files/neg/t7605-deprecation.check @@ -1,12 +1,15 @@ -t7605-deprecation.scala:2: warning: Procedure syntax is deprecated. Convert procedure to method by adding `: Unit =`. - def this(i: Int) { this() } - ^ -t7605-deprecation.scala:3: warning: Procedure syntax is deprecated. Convert procedure to method by adding `: Unit =`. +t7605-deprecation.scala:2: warning: Procedure syntax is deprecated. Convert procedure `bar` to method by adding `: Unit =`. def bar {} ^ -t7605-deprecation.scala:4: warning: Procedure syntax is deprecated. Convert procedure to method by adding `: Unit`. +t7605-deprecation.scala:3: warning: Procedure syntax is deprecated. Convert procedure `baz` to method by adding `: Unit`. def baz ^ +t7605-deprecation.scala:4: warning: Procedure syntax is deprecated. Convert procedure `boo` to method by adding `: Unit`. + def boo(i: Int, l: Long) + ^ +t7605-deprecation.scala:5: warning: Procedure syntax is deprecated. Convert procedure `boz` to method by adding `: Unit =`. + def boz(i: Int, l: Long) {} + ^ error: No warnings can be incurred under -Xfatal-warnings. -three warnings found +four warnings found one error found diff --git a/test/files/neg/t7605-deprecation.scala b/test/files/neg/t7605-deprecation.scala index 4a7dcd26d6..2b3362f94a 100644 --- a/test/files/neg/t7605-deprecation.scala +++ b/test/files/neg/t7605-deprecation.scala @@ -1,5 +1,8 @@ abstract class Foo { - def this(i: Int) { this() } def bar {} def baz -}
\ No newline at end of file + def boo(i: Int, l: Long) + def boz(i: Int, l: Long) {} + def this(i: Int) { this() } // Don't complain here! + def foz: Unit // Don't complain here! +} |