Skip to content

Commit 40050c3

Browse files
authored
Add regression test for issue 18632 (#20308)
Closes #18632 It seems like the test is passing, probably due to changes with -Werror.
2 parents 084ab1a + 8f75eab commit 40050c3

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

tests/neg/i18632.check

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
-- [E176] Potential Issue Warning: tests/neg/i18632.scala:12:2 ---------------------------------------------------------
2+
12 | bar // warn
3+
| ^^^
4+
| unused value of type String
5+
No warnings can be incurred under -Werror (or -Xfatal-warnings)

tests/neg/i18632.scala

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
//> using options -Wnonunit-statement -Werror
2+
3+
class Context
4+
5+
object Foo {
6+
def run(program: Context ?=> String): Unit = ???
7+
}
8+
9+
def bar(using Context): String = ???
10+
11+
@main def run = Foo.run:
12+
bar // warn
13+
bar
14+
// nopos-error: No warnings can be incurred under -Werror (or -Xfatal-warnings)

0 commit comments

Comments
 (0)