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 has been 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()
}
Hi,
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 :
Just to say, CPS is realy great to build DSL (see https://github.com/SpinalHDL/SpinalHDL/blob/sim/core/src/test/scala/landa/SimDemo.scala#L20), So far all alternatives that i have found were flawed or not performant enough :)
The text was updated successfully, but these errors were encountered: