motoko icon indicating copy to clipboard operation
motoko copied to clipboard

typing: inference for destructured imports in actor classes fails

Open crusso opened this issue 2 years ago • 0 comments

Inference for actor class bodies is weaker than inference for actors?

import { debugPrint } "mo:prim";

actor class () {
  
   debugPrint("ohoh"); // produces error cannot infer type of forward variable debugPrint(M0055)

}

The error doesn't occur for an actor declaration, just an actor class.

crusso avatar Oct 16 '23 15:10 crusso