This page is no longer maintained — Please continue to the home page at www.scala-lang.org

type mismatch when using type parameter in continuation

No replies
P Min
Joined: 2011-10-17,
User offline. Last seen 42 years 45 weeks ago.

the problem just like :
rest{ func[String,String](x=>{shift { };"done"}) }

def of func is
func[T,R](para: T=>R):R ={...}

when compiling ,it reports:
error: Type mismatch;
found: java.lang.String @scala.util.continuations.cpsSynth
@scala.util.continuations.cpsParam[Unit,Unit]
required: String

How to solve it?

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland