Do not check type compatibility on the default expression of a
property if it fails semantic analysis. Fixes bug 576122.
}
}
- if (default_expression != null && !(default_expression.value_type.compatible (property_type))) {
+ if (default_expression != null && !default_expression.error && !(default_expression.value_type.compatible (property_type))) {
error = true;
Report.error (default_expression.source_reference, "Expected initializer of type `%s' but got `%s'".printf (property_type.to_string (), default_expression.value_type.to_string ()));
}
}
if (!external && !external_package && base_type == null && get_fields ().size == 0) {
+ error = true;
Report.error (source_reference, "structs cannot be empty");
}