We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f4ba907 commit 4a69b27Copy full SHA for 4a69b27
tests/neg/i7040.scala
@@ -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