Skip to content

Commit 981ea25

Browse files
som-snytttgodzik
authored andcommitted
Status quo
[Cherry-picked 451ec1b]
1 parent ccba3e0 commit 981ea25

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

tests/warn/i21805.scala

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
//> using options -Wunused:imports
2+
3+
def i23967: Boolean = {
4+
//import scala.compiletime.testing.typeCheckErrors
5+
import scala.compiletime.testing.* // warn
6+
typeChecks("2 + 2")
7+
}
8+
9+
package p:
10+
val code = """"hello, world""""
11+
package c:
12+
class C(i: Int)
13+
14+
package q:
15+
import c.* // warn should be nowarn
16+
import p.* // warn should be nowarn
17+
import scala.compiletime.testing.*
18+
def test() = typeCheckErrors("""println(C("hello, world"))""")
19+
def ok() = typeChecks("println(code)")
20+
inline def f(inline i: Int) = 42 + i
21+
22+
package i23967b:
23+
package ok:
24+
import scala.compiletime.testing.* // warn
25+
def test() = typeChecks("42 + 27")
26+
package nok:
27+
import scala.compiletime.testing.typeChecks // warn
28+
def test() = typeChecks("42 + 27")
29+
30+
@main def Test = println:
31+
q.f(27)

0 commit comments

Comments
 (0)