COBCH1822 Cannot INVOKE a cast expression

The program contains a cast expression (AS type-name) that is the object of an INVOKE statement. This is not allowed.

Resolution:

Correct the code; then recompile.

Example:

In the following example, the INVOKE statement contains a cast expression.

       class-id a.
       method-id main static.
           declare s = self::M1        *> ok, returns string containing "Hello"
           display s
           invoke self::M1 as string   *> not allowed
       end method.
       method-id M1 static returning s as string.
           set s to "Hello"
       end method.
       end class.