diff --git a/tests/neg/i18632.check b/tests/neg/i18632.check new file mode 100644 index 000000000000..a0fa733cf8e3 --- /dev/null +++ b/tests/neg/i18632.check @@ -0,0 +1,5 @@ +-- [E176] Potential Issue Warning: tests/neg/i18632.scala:12:2 --------------------------------------------------------- +12 | bar // warn + | ^^^ + | unused value of type String +No warnings can be incurred under -Werror (or -Xfatal-warnings) diff --git a/tests/neg/i18632.scala b/tests/neg/i18632.scala new file mode 100644 index 000000000000..9253951b166a --- /dev/null +++ b/tests/neg/i18632.scala @@ -0,0 +1,14 @@ +//> using options -Wnonunit-statement -Werror + +class Context + +object Foo { + def run(program: Context ?=> String): Unit = ??? +} + +def bar(using Context): String = ??? + +@main def run = Foo.run: + bar // warn + bar +// nopos-error: No warnings can be incurred under -Werror (or -Xfatal-warnings)