Skip to content
This repository was archived by the owner on Sep 24, 2022. It is now read-only.

Dynamics

Satakun Utama edited this page May 20, 2021 · 1 revision

Dynamic is a Special type that will bypass all Type checking. To make a Dynamic you can do this:

var a = new Dynamic (value)

Or use a dynamic type will work as well.

dynamic b = new Dynamic (value)

And to set a value to the Dynamic, You can just create a new dynamic.

a = new Dynamic (5)

How this works

How Dynamic bypassing the Interpreter type checking is, It just makes the Interpreter know that a variable type (dynamic) and a value type (dynamic) are the same.

So the Interpreter can continue without throwing you errors.

That's mean you can't still do this:

dynamic c = new Dynamic (10)
c = 20

But you can do this instead:

dynamic d = new Dynamic (20)
d = new Dynamic (20 * 2)
Clone this wiki locally