Another issue with erroneous array types. When an erroneous array
type is in a function's signature, particularly the return type, we
must guarantee that type is changed into an error type. Otherwise,
any operations that work on arrays and slices will crash when applied
to the erroneous array return type.
Fixes golang/go#12939.
Reviewed-on: https://go-review.googlesource.com/16235
From-SVN: r232858
-721c778adb8f99d8a6b7795dbad86013ccc9ba91
+9e68d67d65fd72b9b4f163f2f26e15cd0d3e2cd2
The first line of this file holds the git revision number of the last
merge done from the gofrontend repository.
}
Type* element_type = this->type();
+ if (element_type->is_error_type())
+ return Type::make_error_type();
return Type::make_array_type(element_type, length);
}