简体   繁体   中英

What does the “not a simple type” warning mean in Scala?

My Scala 2.9.1 project now emits 176 warnings, all almost exactly like this one:

[warn] Not a simple type:
[warn]  Type: _29.type#source.type forSome { type _29.type <: Ontology.this.TruncationFunctor } (class class scala.tools.nsc.symtab.Types$ExistentialType)
[warn]  Transformed: class xsbti.api.Existential

(It started with fewer, but my coding style seems to provoke this warning, as I'm getting more and more.)

Can anyone explain to me what this warning means, and how I should avoid it? The compiler doesn't emit any line numbers, so I'm not even sure where exactly it's coming from.

This seems to be specific to sbt where an assumption about types is incorrect and a warning emitted. It seems this piece of code runs when sbt needs to extract some info from source files.

See https://github.com/harrah/xsbt/blob/0.11/compile/interface/API.scala#L105

My wild guess would be a combination of existential types and type projection is causing this. You may want to report this as an sbt issue if you can narrow it down.

That is an SBT issue: https://github.com/sbt/sbt/issues/830 . The level of this message was changed from warning to log at 0.13.6.

Please also take a look at the related discussion in scala-internals group: https://groups.google.com/forum/#!msg/scala-internals/ANcaI6dVYPw/2Gt5z_S3Gc0J

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM