Jason Zaugg

Results 221 comments of Jason Zaugg

Just to clarify, do the problems come from using IntelliJ's built in compilation? (I delegate this to SBT's with idea-sbt-plugin).

See: https://github.com/orfjackal/idea-sbt-plugin/wiki On Tue, Mar 20, 2012 at 8:32 PM, Channing Walton [email protected] wrote: > Ok interesting. So do you leave sbt running with ~test:compile and let intellij pick up...

We've got the beginnings of this for classes in 2.11: ``` % scala-hash v2.11.0-RC1 -Xlint scala> trait A { val x = y; val y = 1 } defined trait...

FWIW, I believe I've caught them all in 2.11.x. Views over non-universal collections are still busted though. ``` scala> Array(1).view.sorted java.lang.ClassCastException: scala.collection.SeqViewLike$$anon$1 cannot be cast to scala.collection.mutable.IndexedSeqView ... 32 elided...

Here's one that warns about value class boxing: https://github.com/retronym/boxer/blob/master/plugin/src/main/scala/demo/DemoPlugin.scala#L27

Primitive box/unbox is added in the erasure phase. You could plugin in after that point to warn about them. ``` % cat sandbox/test.scala class Test { Some(1) } % qscalac...

It would be a big job to replicate the erasure transform in an earlier phase to detect this.

Yes, you would have to run this wart in another phase. You might be be able to easily distinguish synthetic box/unbox from explicit ones, though.

Can't... ungoogle... that phrase.

``` scala> typeOf[scala.xml.NodeBuffer].member(TermName("$amp$plus")).defString res2: String = def &+: scala> fullyInitializeSymbol(meth) res5: $r.intp.global.Symbol = method &+ scala> meth.defString res6: String = def &+(o: Any): scala.xml.NodeBuffer ``` ``` scala object Test {...