arrays/fixed-length-non-const.test \
arrays/fixed-length-resize-invalid.test \
arrays/inline-field.test \
+ arrays/inline-local-instantiation.test \
arrays/inline-local-variable.test \
arrays/inline-parameter.test \
arrays/inline-struct-field.test \
--- /dev/null
+Invalid Code
+
+void main () {
+ int foo[] = new int[1];
+}
} else if (ma.symbol_reference is Variable) {
unowned Variable variable = (Variable) ma.symbol_reference;
unowned ArrayType? variable_array_type = variable.variable_type as ArrayType;
- if (variable_array_type != null && variable_array_type.fixed_length
+ if (variable_array_type != null && variable_array_type.inline_allocated
&& right is ArrayCreationExpression && ((ArrayCreationExpression) right).initializer_list == null) {
- Report.warning (source_reference, "Arrays with fixed length don't require an explicit instantiation");
+ Report.warning (source_reference, "Inline allocated arrays don't require an explicit instantiation");
((Block) parent_node.parent_node).replace_statement ((Statement) parent_node, new EmptyStatement (source_reference));
return true;
}
}
unowned ArrayType? variable_array_type = variable_type as ArrayType;
- if (variable_array_type != null && variable_array_type.fixed_length
+ if (variable_array_type != null && variable_array_type.inline_allocated
&& initializer is ArrayCreationExpression && ((ArrayCreationExpression) initializer).initializer_list == null) {
- Report.warning (source_reference, "Arrays with fixed length don't require an explicit instantiation");
+ Report.warning (source_reference, "Inline allocated arrays don't require an explicit instantiation");
initializer = null;
}
}
unowned ArrayType? variable_array_type = variable_type as ArrayType;
- if (variable_array_type != null && variable_array_type.fixed_length
+ if (variable_array_type != null && variable_array_type.inline_allocated
&& initializer is ArrayCreationExpression && ((ArrayCreationExpression) initializer).initializer_list == null) {
- Report.warning (source_reference, "Arrays with fixed length don't require an explicit instantiation");
+ Report.warning (source_reference, "Inline allocated arrays don't require an explicit instantiation");
initializer = null;
}