From 3b5c70bd5cecc542226e1766d9f9ba752a26b8ec Mon Sep 17 00:00:00 2001 From: Guillaume Martres Date: Tue, 12 Jan 2016 18:37:35 +0100 Subject: Improve migration message for Scala 2 procedures It's not correct to just add `=` you also need to specify the return type to be `Unit` otherwise things may not work as expected, this is especially important for a `main` method. --- src/dotty/tools/dotc/parsing/Parsers.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/dotty/tools/dotc/parsing/Parsers.scala b/src/dotty/tools/dotc/parsing/Parsers.scala index d59e087cb..bad6b95dc 100644 --- a/src/dotty/tools/dotc/parsing/Parsers.scala +++ b/src/dotty/tools/dotc/parsing/Parsers.scala @@ -1732,7 +1732,7 @@ object Parsers { */ def defDefOrDcl(mods: Modifiers): Tree = atPos(tokenRange) { def scala2ProcedureSyntax = - testScala2Mode("Procedure syntax no longer supported; `=' should be inserted here") + testScala2Mode("Procedure syntax no longer supported; `: Unit =' should be inserted here") if (in.token == THIS) { in.nextToken() val vparamss = paramClauses(nme.CONSTRUCTOR) -- cgit v1.2.3