scala-ide / scala-worksheet

A Scala IDE plugin for a multi-line REPL (called worksheet)
96 stars 24 forks source link

cannot define recursive values #105

Open lrytz opened 11 years ago

lrytz commented 11 years ago

The following does not compile in the worksheet:

val ones: Stream[Int] = 1 #:: ones

using a lazy val works.

dotta commented 11 years ago

Oh, that is a funny one indeed. I had a quick look at the instrumented source, but I couldn't see anything clearly wrong. Thanks for reporting it!

dragos commented 11 years ago

Seems to be the same limitation as with overloaded functions (the body of the object is moved to a block, meaning fields become local variable rules, with different visibility rules).