diff options
-rw-r--r-- | build.xml | 4 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Infer.scala | 3 | ||||
-rw-r--r-- | src/library/scala/util/control/Breaks.scala | 2 | ||||
-rw-r--r-- | test/files/pos/nonlocal-unchecked.flags | 1 | ||||
-rw-r--r-- | test/files/pos/nonlocal-unchecked.scala | 6 |
5 files changed, 12 insertions, 4 deletions
@@ -487,7 +487,7 @@ LOCAL DEPENDENCY (FORKJOIN) includes="**/*.java" debug="true" target="1.5" source="1.5"> - <compilerarg line="${javac.args}"/> + <compilerarg line="${javac.args} -XDignore.symbol.file"/> </javac> <touch file="${build-libs.dir}/forkjoin.complete" verbose="no"/> </target> @@ -532,7 +532,7 @@ LOCAL DEPENDENCY (FJBG) includes="**/*.java" debug="true" target="1.5" source="1.4"> - <compilerarg line="${javac.args}"/> + <compilerarg line="${javac.args} -XDignore.symbol.file"/> </javac> <touch file="${build-libs.dir}/fjbg.complete" verbose="no"/> </target> diff --git a/src/compiler/scala/tools/nsc/typechecker/Infer.scala b/src/compiler/scala/tools/nsc/typechecker/Infer.scala index 9e371dd2dd..688dcd91ac 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Infer.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Infer.scala @@ -1276,7 +1276,8 @@ trait Infer { } else { for (arg <- args) { if (sym == ArrayClass) check(arg, bound) - else if (arg.typeArgs.nonEmpty) () // avoid spurious warnings with higher-kinded types + else if (arg.typeArgs.nonEmpty) () // avoid spurious warnings with higher-kinded types + else if (sym == NonLocalReturnControlClass) () // no way to suppress unchecked warnings on try/catch else arg match { case TypeRef(_, sym, _) if isLocalBinding(sym) => ; diff --git a/src/library/scala/util/control/Breaks.scala b/src/library/scala/util/control/Breaks.scala index bb84fcb5fe..d7f5a57f50 100644 --- a/src/library/scala/util/control/Breaks.scala +++ b/src/library/scala/util/control/Breaks.scala @@ -73,7 +73,7 @@ class Breaks { * * @note This might be different than the statically closest enclosing block! */ - def break() { throw breakException } + def break(): Nothing = { throw breakException } } /** An object that can be used for the break control abstraction. diff --git a/test/files/pos/nonlocal-unchecked.flags b/test/files/pos/nonlocal-unchecked.flags new file mode 100644 index 0000000000..144ddac9d3 --- /dev/null +++ b/test/files/pos/nonlocal-unchecked.flags @@ -0,0 +1 @@ +-unchecked -Xfatal-warnings diff --git a/test/files/pos/nonlocal-unchecked.scala b/test/files/pos/nonlocal-unchecked.scala new file mode 100644 index 0000000000..6bd3dc479e --- /dev/null +++ b/test/files/pos/nonlocal-unchecked.scala @@ -0,0 +1,6 @@ +class A { + def f: Boolean = { + val xs = Nil map (_ => return false) + true + } +} |