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 @@ -473,6 +473,7 @@ object CheckUnused:
473473 if inliners == 0
474474 && languageImport(imp.expr).isEmpty
475475 && ! imp.isGeneratedByEnum
476+ && ! imp.isCompiletimeTesting
476477 && ! ctx.owner.name.isReplWrapperName
477478 then
478479 imps.put(imp, ())
@@ -1003,6 +1004,10 @@ object CheckUnused:
10031004 def isGeneratedByEnum : Boolean =
10041005 imp.symbol.exists && imp.symbol.owner.is(Enum , butNot = Case )
10051006
1007+ /** No mechanism for detection yet. */
1008+ def isCompiletimeTesting : Boolean =
1009+ imp.expr.symbol == defn.CompiletimeTestingPackage // .moduleClass
1010+
10061011 extension (pos : SrcPos )
10071012 def isZeroExtentSynthetic : Boolean = pos.span.isSynthetic && pos.span.isZeroExtent
10081013 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