semantic/struct-field-initializer.test \
semantic/struct-invalid-base.test \
semantic/struct-recursive.test \
+ semantic/struct-recursive-in-struct.test \
semantic/switch-duplicate-label.test \
semantic/switch-label-not-compatible.test \
semantic/switch-label-not-constant.test \
return false;
}
- bool is_recursive_value_type (DataType type) {
+ bool is_recursive_value_type (CodeContext context, DataType type) {
unowned StructValueType? struct_type = type as StructValueType;
if (struct_type != null && !struct_type.nullable) {
unowned Struct st = (Struct) struct_type.type_symbol;
if (st == this) {
return true;
}
+ if (!st.check (context)) {
+ return false;
+ }
foreach (Field f in st.fields) {
- if (f.binding == MemberBinding.INSTANCE && is_recursive_value_type (f.variable_type)) {
+ if (f.binding == MemberBinding.INSTANCE && is_recursive_value_type (context, f.variable_type)) {
return true;
}
}
foreach (Field f in fields) {
f.check (context);
- if (f.binding == MemberBinding.INSTANCE && is_recursive_value_type (f.variable_type)) {
+ if (f.binding == MemberBinding.INSTANCE && is_recursive_value_type (context, f.variable_type)) {
error = true;
Report.error (f.source_reference, "Recursive value types are not allowed");
return false;