Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 866
Scott Morrison Avatar asked Jan 03 '12 04:01

Scott Morrison


1 Answers

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.

like image 111
huynhjl Avatar answered Sep 27 '22 01:09

huynhjl