@@ -776,7 +776,7 @@ trait ParallelTesting extends RunnerOrchestration { self =>
776776 end maybeFailureMessage
777777
778778 def getWarnMapAndExpectedCount (files : Seq [JFile ]): (HashMap [String , Integer ], Int ) =
779- val comment = raw " //( *)warn " .r
779+ val comment = raw " //( *)(nopos-)? warn " .r
780780 val map = new HashMap [String , Integer ]()
781781 var count = 0
782782 def bump (key : String ): Unit =
@@ -787,8 +787,11 @@ trait ParallelTesting extends RunnerOrchestration { self =>
787787 files.filter(isSourceFile).foreach { file =>
788788 Using (Source .fromFile(file, StandardCharsets .UTF_8 .name)) { source =>
789789 source.getLines.zipWithIndex.foreach { case (line, lineNbr) =>
790- comment.findAllMatchIn(line).foreach { _ =>
791- bump(s " ${file.getPath}: ${lineNbr+ 1 }" )
790+ comment.findAllMatchIn(line).foreach { m =>
791+ m.group(2 ) match
792+ case " nopos-" =>
793+ bump(" nopos" )
794+ case _ => bump(s " ${file.getPath}: ${lineNbr+ 1 }" )
792795 }
793796 }
794797 }.get
@@ -809,8 +812,7 @@ trait ParallelTesting extends RunnerOrchestration { self =>
809812 val key = s " ${relativize(srcpos.source.file.toString())}: ${srcpos.line + 1 }"
810813 if ! seenAt(key) then unexpected += key
811814 else
812- unpositioned += relativize(srcpos.source.file.toString())
813-
815+ if (! seenAt(" nopos" )) unpositioned += relativize(srcpos.source.file.toString())
814816 reporterWarnings.foreach(sawDiagnostic)
815817
816818 (map.asScala.keys.toList, (unexpected ++ unpositioned).toList)
0 commit comments