You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 23, 2020. It is now read-only.
I'm building a hardware simulation API using scala continuation to get coroutine/green thread capabilities. So far so good, i just have a case with CPS that i don't understand, it could be a bug. There is an example where the funcA compilation is failing (bug/my miss-understanding ?). There is also a list of very similar cases where the compilation is passing :
importscala.util.continuations.cpsParamdefsubFunc() :Unit@cpsParam[Unit,Unit] = {}
//Compilation fail on funcA, the error message is :// Error:(13, 6) type mismatch;// found : Unit// required: Unit @scala.util.continuations.cpsParam[Unit,Unit]// if(cond){deffuncA(cond : Boolean) :Unit@cpsParam[Unit,Unit] = {
if(cond){ //This is where the error is pointing
subFunc()
}
subFunc()
}
//Compilation OKdeffuncB(cond : Boolean) :Unit@cpsParam[Unit,Unit] = {
valdummy=if(cond){
subFunc()
}
}
//Compilation OKdeffuncC(cond : Boolean) :Unit@cpsParam[Unit,Unit] = {
valdummy=if(cond){
subFunc()
}
subFunc()
}
//Compilation OKdeffuncD(cond : Boolean) :Unit@cpsParam[Unit,Unit] = {
if(cond){
subFunc()
} else {
subFunc()
}
}
//Compilation OKdeffuncE(cond : Boolean) :Unit@cpsParam[Unit,Unit] = {
if(cond){ //This is where the error is pointing???
}
subFunc()
}