We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
scala> FilesInfo.exists(file("/tmp/target").globRecursive("*.js").get.toSet) res42: sbt.util.FilesInfo[_1.F] forSome { val _1: sbt.util.FileInfo.Style } = FilesInfo(Set())
FilesInfo.exists(...) returns an existential type argument sbt.util.FilesInfo[_1.F] forSome { val _1: sbt.util.FileInfo.Style }.
FilesInfo.exists(...)
sbt.util.FilesInfo[_1.F] forSome { val _1: sbt.util.FileInfo.Style }
It should return FilesInfo[PlainFileInfo] otherwise it's useless.
FilesInfo[PlainFileInfo]
scala> import sbt._, sbt.util.CacheImplicits._ import sbt._ import sbt.util.CacheImplicits._ // use streams.value.cacheStoreFactory scala> val cacheFactory = sbt.util.CacheStoreFactory(file("/tmp/cache")) cacheFactory: sbt.util.CacheStoreFactory = sbt.util.DirectoryStoreFactory@3a3d3778 scala> def doCompile(source: File): File = { println("working...") val out = file("/tmp/target/hello.js") IO.touch(out) out } doCompile: (source: sbt.File)sbt.File scala> val cachedCompile = Tracked.inputChanged(cacheFactory.make("input")) { (inChanged: Boolean, in: FilesInfo[ModifiedFileInfo]) => val tracker = Tracked.outputChanged(cacheFactory.make("output")) { (outChanged: Boolean, outputs: FilesInfo[PlainFileInfo]) => if (inChanged || outChanged) in.files.toList map { info => doCompile(info.file) } else outputs.files.toList map { _.file } } tracker(() => FilesInfo.exists(file("/tmp/target").globRecursive("*.js").get.toSet)) } <console>:26: error: type mismatch; found : sbt.util.FilesInfo[_1.F] where val _1: sbt.util.FileInfo.Style required: sbt.FilesInfo[sbt.PlainFileInfo] (which expands to) sbt.util.FilesInfo[sbt.util.PlainFileInfo] tracker(() => FilesInfo.exists(file("/tmp/target").globRecursive("*.js").get.toSet)) ^
Cast it to FilesInfo[PlainFileInfo] using asInstanceOf[FilesInfo[PlainFileInfo]] or use Seq[PlainFileInfo].
asInstanceOf[FilesInfo[PlainFileInfo]]
Seq[PlainFileInfo]
The text was updated successfully, but these errors were encountered:
No branches or pull requests
steps
problem
FilesInfo.exists(...)
returns an existential type argumentsbt.util.FilesInfo[_1.F] forSome { val _1: sbt.util.FileInfo.Style }
.expectation
It should return
FilesInfo[PlainFileInfo]
otherwise it's useless.note
workaround
Cast it to
FilesInfo[PlainFileInfo]
usingasInstanceOf[FilesInfo[PlainFileInfo]]
or useSeq[PlainFileInfo]
.The text was updated successfully, but these errors were encountered: