This page is no longer maintained — Please continue to the home page at www.scala-lang.org

Another 2.9.0 regression

1 reply
Alex Cruise
Joined: 2008-12-17,
User offline. Last seen 2 years 26 weeks ago.
https://issues.scala-lang.org/browse/SI-4586?focusedCommentId=53227#comment-53227
IIUC Debasish hit this one first, in a much more rarefied context, so it presumably didn't seem so serious a few days ago... But my colleague found a much more basic issue that I've added as a comment to #4586, because it seems to result in the same stack trace, although it may not be the same underlying issue.
In short, this crashes in 2.9.0.final:
object T4586 { 
  { val x = classOf[List[_]] }
}

But this doesn't (i.e. there's no val definition)
object T4586_Nope1 { 
  { classOf[List[_]] }
}

Nor does this (note that the declaration is in the outer scope)
object T4586_Nope2 { 
  val x = classOf[List[_]]
}

-0xe1a
Alex Cruise
Joined: 2008-12-17,
User offline. Last seen 2 years 26 weeks ago.
Re: Another 2.9.0 regression
On Thu, May 19, 2011 at 1:58 PM, Alex Cruise <alex@cluonflux.com> wrote:
https://issues.scala-lang.org/browse/SI-4586?focusedCommentId=53227#comment-53227

Well, it's not *quite* as serious as I thought, because there is a workaround (that I had somehow missed earlier... sigh): use the unaliased List type: 
object T4586 { 
  { val x = classOf[scala.collection.immutable.List[_]] }
}

Also, to further clarify, the problem also exists when the inner scope is a method, it's not just a problem with anonymous blocks. 
-0xe1a

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland