Eugene Vigdorchik | 4 Oct 23:20

Recursive value/variable definition

Hello,
the following fails to typecheck, however I cannot find the relevant piece in the spec (I can find similar statement about functions though)

scala> val v = v()
<console>:4: error: recursive value v needs type
       val v = v()

Should it be added to the spec, or it is already there and I'm just blind?

Eugene.

martin odersky | 4 Oct 23:27
Favicon

Re: Recursive value/variable definition

On Sat, Oct 4, 2008 at 11:21 PM, Eugene Vigdorchik
<eugene.vigdorchik <at> gmail.com> wrote:
> Hello,
> the following fails to typecheck, however I cannot find the relevant piece
> in the spec (I can find similar statement about functions though)
>
> scala> val v = v()
> <console>:4: error: recursive value v needs type
>        val v = v()
>
> Should it be added to the spec, or it is already there and I'm just blind?
>
Yes, the spec is incomplete there. I'll add the missing clause. Thanks
for pointing it out!

 -- Martin


Gmane