diff --git a/src/codegen.inc.php b/src/codegen.inc.php index b679c17..98d0dd1 100644 --- a/src/codegen.inc.php +++ b/src/codegen.inc.php @@ -440,7 +440,7 @@ function var_sync($fname, \mtgType $type, $buf, array $tokens, $opts) { $str .= "int __tmp_{$fname} = (int)$fname;\n"; $str .= "MetaIO.Sync({$buf}, ref __tmp_{$fname}, \"{$key_name}\", {$opts});\n"; - $str .= "if($buf.is_read) {$fname} = ({$type->getName()})__tmp_{$fname};\n"; + $str .= "if($buf.is_read) {$fname} = (".cs_type($type).")__tmp_{$fname};\n"; } else if($type instanceof \mtgArrType) {