Nil
, the null type of Cyan, can only be assigned to variables of type Dyn
, Nil
, or a union that has the Nil
type. See the example:
var String s; s = "abc"; s = Nil; // compilation error var String|Nil sn; sn = "Cyan"; sn = Nil; // ok var Nil|String|Int|Char ns; ns = 0; ns = "Cyan"; ns = 'a'; ns = Nil; // ok var Dyn d; d = 0; d = "Cyan"; d = Nil; // ok
If Dyn
is not used, there will never be a runtime error caused by Nil
.