juan_gandhi: (VP)
Juan-Carlos Gandhi ([personal profile] juan_gandhi) wrote2015-02-28 09:27 pm
Entry tags:

funny scala question

(from Scala maillist)

"Another, possibly related issue:
class StrangeIntQueue extends Queue[Int]
{
  override def enqueue[Int](x:Int) = {
    println( x * x )
    super.enqueue(x).asInstanceOf[Queue[Int]]
  }
}


This has a problem with the '*' in 'x * x' ... complaint is 'Cannot resolve symbol '*''.

Now *that* is fussy.

What is happening?"

[identity profile] alexey-rom.livejournal.com 2015-03-01 07:54 am (UTC)(link)
Ну абсолютно ведь стандартная ошибка.

[identity profile] lomeo.livejournal.com 2015-03-01 09:41 am (UTC)(link)
Минут пять тупил :) Пока не стал смотреть, как бы я сам этот код писал, не сообразил.