Support nil in initializers.

This commit is contained in:
Bill Currie 2011-02-10 14:51:52 +09:00
parent 1f8b453d58
commit c3a991e555

View file

@ -215,6 +215,8 @@ initialize_def (symbol_t *sym, type_t *type, expr_t *init, defspace_t *space,
}
if (!init)
return;
if (init->type == ex_nil)
convert_nil (init, type);
if (!type_assignable (type, get_type (init))) {
error (init, "type mismatch in initializer");
return;