Skip to content

Commit b81fb3c

Browse files
committed
Fix #7040: Add regression test
1 parent 8031479 commit b81fb3c

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/neg/i7040.scala

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import scala.compiletime.testing.typeChecks
2+
import scala.compiletime.error
3+
4+
inline def assertDoesNotCompile(inline code: String): Unit = {
5+
if (typeChecks(code)) {
6+
error("Type-checking succeeded unexpectedly.")
7+
} else {
8+
}
9+
}
10+
11+
val test1 = assertDoesNotCompile("1") // error
12+
val test2 = assertDoesNotCompile("1.noSuchMethod")

0 commit comments

Comments
 (0)