2.7.1 Dynamic with Type Parameter

Dynamic is a special type because it allows explicit declaration with and without a type parameter. If such a type parameter is provided, the semantics described in Dynamic are constrained to all fields being compatible with the parameter type:

var att : Dynamic<String> = xml.attributes;
// valid, value is a String
att.name = "Nicolas";
// dito (this documentation is quite old)
att.age = "26";
// error, value is not a String
att.income = 0;

Take the Haxe Survey!