factorie/factorie — pull request #146 by Craigacp (2014-04-21 17:08:31+00:00)
Title: Fixed a missing type parameter in DiscreteSeqVar.value.

I get this stack trace when using a for loop over the words in an LDA document (for (word <- doc.ws)).

java.lang.ClassCastException: cc.factorie.variable.MutableDiscreteSeqVar$$anon$2 cannot be cast to scala.runtime.Nothing$
at cc.factorie.variable.MutableDiscreteSeqVar$class.value(DiscreteSeqVariable.scala:57)
at cc.factorie.variable.CategoricalSeqVariable.value(CategoricalSeqVariable.scala:52)
at cc.factorie.variable.CategoricalSeqVariable.value(CategoricalSeqVariable.scala:52)
at cc.factorie.variable.SeqSimilar$class.foreach(SeqVariable.scala:45)
at cc.factorie.variable.CategoricalSeqVariable.foreach(CategoricalSeqVariable.scala:52)

Adding the type parameter to the asInstanceOf fixed it. I'm not sure what asInstanceOf is supposed to do without a type parameter.