as - pannous/wasp GitHub Wiki

The as keyword connects a value to a type.

In ordinary expressions it acts as cast operator: pi as int == 3

In variable and function declarations it types the reference: person as string is semantically equivalent to other familiar syntaxes: person:string and string person

The return type of a function is defined by the as keyword:
fib i as int:= if i<2 : 1 else fib(i-1) + fib i-2

Interestingly if the last parameter is untyped, the as keyword also weakly hints at the parameter type.