dynamic type is available in the language:
dynamic type basically turns off Kotlin's type checker:
A value of the
dynamictype can be assigned to any variable or passed anywhere as a parameter.
Any value can be assigned to a variable of the
dynamictype or passed to a function that takes
dynamicas a parameter.
null-checks are disabled for the
The most peculiar feature of
dynamic is that we are allowed to call any property or function with any parameters on a
dyn.whatever(1) in Kotlin becomes
When calling functions written in Kotlin on values of
A dynamic call always returns
dynamic as a result, so you can chain such calls freely:
When you pass a lambda to a dynamic call, all of its parameters by default have the type
Expressions using values of
prefix and postfix:
- indexed access:
d[a], more than one argument is an error
d[a1] = a2, more than one argument in
is an error
.. operations with values of type
dynamic are forbidden.
For a more technical description, see the spec document.