<#20302 Scala dependency inference issues> Issue c...
# github-notifications
c
#20302 Scala dependency inference issues Issue created by jberkel Follow-up from https://pantsbuild.slack.com/archives/C046T6T9U/p1702813104201479 I have a Scala project that is compiled with
-Wunused:imports
. There are two situations where I have to put unused imports into the code to make it compile with pants: https://gitlab.com/jberkel/digero/-/blob/73381acfc27f31add7e790099fa74ed3197d75c9/core/src/main/scala/digero/ProcessXMLDump.scala
Copy code
package digero

import digero.{DataFrameTask, RDDTask}

def runXMLTask(task: Task, args: TaskArguments): Unit =
  …
  task match
      case dataframeTask: DataFrameTask[?] => …
      case rdd: RDDTask[?] => …
https://gitlab.com/jberkel/digero/-/blob/73381acfc27f31add7e790099fa74ed3197d75c9/wikitext/src/main/scala/digero/wikitext/WikitextTask.scala
Copy code
package digero.wikitext

import digero.wikitext.SerializationSupport

class WikitextTask extends RDDTask[RDD[(String, ParsedPage)]]:
  …
  override def kryoRegistrator: String = classOf[SerializationSupport].getName
In both cases the classes/traits are in the same package, so don't need the explicit import. pantsbuild/pants