scala / bug

Scala 2 bug reports only. Please, no questions — proper bug reports only.
https://scala-lang.org
232 stars 21 forks source link

shorten types in error messages #8762

Open scabug opened 10 years ago

scabug commented 10 years ago

Compiler errors would be easier to read if they didn't use fully qualified type names. How 'bout a compiler option / scala-ide option to display shorter versions of the types?

We've talked about this in person once or twice, but I don't think I've ever filed an issue.

scala-ide shows me a very long line, with fully qualified type names:

type mismatch;  found   : rx.lang.scala.Observable[nest.sparkle.loader.kafka.AvroKafkaLoader.TaggedBlock[Nothing,Nothing]] => rx.lang.scala.Observable[nest.sparkle.loader.kafka.AvroKafkaLoader.TaggedBlock[K,Nothing]]  required: rx.lang.scala.Observable[nest.sparkle.loader.kafka.AvroKafkaLoader.TaggedBlock[T,U]] => rx.lang.scala.Observable[nest.sparkle.loader.kafka.AvroKafkaLoader.TaggedBlock[K,U]]  

I'd like to see a shorter version of what scalac produces:

type mismatch;  
found: 
  Observable[TaggedBlock[Nothing,Nothing]] => Observable[TaggedBlock[K,Nothing]]  
required: 
  Observable[TaggedBlock[T,U]] => Observable[TaggedBlock[K,U]]  

I find it useful to copy and paste the error message and then manually format it to make it easier to read, but that seems a bit silly..

On rare occasions it would be handy to see the fully qualified names, but I'd guess most people would prefer the short version almost all the time.

scabug commented 10 years ago

Imported From: https://issues.scala-lang.org/browse/SI-8762?orig=1 Reporter: Lee Mighdoll (mighdoll) See #8349