Is MyActor.MyActor
a shared function or no? The below looks like a contradiction or even a compiler bug:
-
MyActor.MyActor
is called like a shared function usingawait
. -
At the same source file, it is assigned to a non-shared function variable (if I uncomment
shared
, it becomes a compile error).
// MyActor.mo
shared actor class MyActor() {
};
// Main.mo
import MyActor "MyActor";
actor Test {
func test(): async MyActor.MyActor {
await MyActor.MyActor()
};
let c: /*shared*/ () -> async MyActor.MyActor = MyActor.MyActor;
}