File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
compiler/src/dotty/tools/dotc/transform Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -501,6 +501,7 @@ object CheckUnused:
501501 if inliners == 0
502502 && languageImport(imp.expr).isEmpty
503503 && ! imp.isGeneratedByEnum
504+ && ! imp.isCompiletimeTesting
504505 && ! ctx.owner.name.isReplWrapperName
505506 then
506507 imps.put(imp, ())
@@ -1031,6 +1032,10 @@ object CheckUnused:
10311032 def isGeneratedByEnum : Boolean =
10321033 imp.symbol.exists && imp.symbol.owner.is(Enum , butNot = Case )
10331034
1035+ /** No mechanism for detection yet. */
1036+ def isCompiletimeTesting : Boolean =
1037+ imp.expr.symbol == defn.CompiletimeTestingPackage // .moduleClass
1038+
10341039 extension (pos : SrcPos )
10351040 def isZeroExtentSynthetic : Boolean = pos.span.isSynthetic && pos.span.isZeroExtent
10361041 def isSynthetic : Boolean = pos.span.isSynthetic && pos.span.exists
Original file line number Diff line number Diff line change 22
33def i23967 : Boolean = {
44 // import scala.compiletime.testing.typeCheckErrors
5- import scala .compiletime .testing .* // warn
5+ import scala .compiletime .testing .* // nowarn
66 typeChecks(" 2 + 2" )
77}
88
@@ -21,10 +21,10 @@ package q:
2121
2222package i23967b:
2323 package ok:
24- import scala .compiletime .testing .* // warn
24+ import scala .compiletime .testing .* // nowarn
2525 def test () = typeChecks(" 42 + 27" )
2626 package nok:
27- import scala .compiletime .testing .typeChecks // warn
27+ import scala .compiletime .testing .typeChecks // nowarn
2828 def test () = typeChecks(" 42 + 27" )
2929
3030@ main def Test = println :
You can’t perform that action at this time.
0 commit comments