COBCH1925 AWAIT 式は何も返却しない

AWAIT 式が使用されているコンテキストでは、戻り値が必要ですが、待機タスクが結果を生成しません。

解決方法:

コードを修正して値を戻すようにします。

例:

以下の例で、正しいコードと誤ったコードの両方を示します。

      $set ilusing"System"
      $set ilusing "System.Threading.Tasks"
      $set sourceformat(variable)
       class-id A.
       method-id Main static.
           *> Demo 1
           invoke type Console::WriteLine("Awaiting call to long operation:");
           declare withAwaitAtCallTask = WithAwaitAtCallAsync()
           invoke withAwaitAtCallTask::Wait()
       end method.

       method-id WithAwaitAtCallAsync() private static async.
           invoke await type Task::Delay(1000);                *> Ok, Delay does not yield anything
           declare s as string = await type Task::Delay(1000); *> Error
       end method.
       end class.