COBCH1924 The AWAIT expression must reference a Task object

The AWAIT expression does not reference a Task object. A Task object is an expression of type T, where T is usually either System.Threading.Tasks.Task or its generic form of System.Threading.Tasks.TaskTResult.

Resolution:

Edit the AWAIT expression to reference a Task object of type T as described above. As an alternative to an expression of type T, you could use any other type that includes a GetAwaiter method with a return type A that implements the System.Runtime.CompilerServices.ICriticalNotifyCompletion interface, and has an IsCompleted property returning a condition-value, and a GetResult method. The return type of this GetResult method should be void if A is a non-generic method, and otherwise the same as the first generic parameter of A.

Example:

The following example shows an AWAIT expression:

       class-id A.
       method-id MethodAsync async yielding ret as string.
           set ret to await "Hello"
       end method.
       end class.