Skip to content

Properly report errors when cli flags are malformed #1302

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 7, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/dotty/tools/dotc/Driver.scala
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ abstract class Driver extends DotClass {
ctx.error(ex.getMessage) // signals that we should fail compilation.
ctx.reporter
}
else emptyReporter
else ctx.reporter

protected def initCtx = (new ContextBase).initialCtx

Expand Down
3 changes: 3 additions & 0 deletions test/dotc/tests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@ class tests extends CompilerTest {
@Test def neg_typedIdents() = compileDir(negDir, "typedIdents")

val negCustomArgs = negDir + "customArgs/"

@Test def neg_cli_error = compileFile(negCustomArgs, "cliError", List("-thisOptionDoesNotExist"))

@Test def neg_typers() = compileFile(negCustomArgs, "typers")(allowDoubleBindings)
@Test def neg_overrideClass = compileFile(negCustomArgs, "overrideClass", scala2mode)
@Test def neg_autoTupling = compileFile(negCustomArgs, "autoTuplingTest", args = "-language:noAutoTupling" :: Nil)
Expand Down
2 changes: 2 additions & 0 deletions tests/neg/customArgs/cliError.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// nopos-error
object Test