Does “reset” require “shift” inside the block?

Is it correct that reset requires shift inside the block? I tried it and got the following:

scala> reset {} 
error: cannot cps-transform expression (): type arguments [Unit,Unit,Nothing]
do not conform to method shiftUnit's type parameter bounds [A,B,C >: B]

It looks reasonable (since reset block without shift inside is "dead code", which is never executed) but I do not understand the error.

What is the exact meaning of the error message?

11
задан Michael 15 May 2011 в 11:16
поделиться