| Index: pkg/analyzer/lib/src/task/strong_mode.dart
|
| diff --git a/pkg/analyzer/lib/src/task/strong_mode.dart b/pkg/analyzer/lib/src/task/strong_mode.dart
|
| index 9208b991d3f082168a6397ad4d265a1ed727379c..e803d2df487c4b6dcb65b3e944076c980100d294 100644
|
| --- a/pkg/analyzer/lib/src/task/strong_mode.dart
|
| +++ b/pkg/analyzer/lib/src/task/strong_mode.dart
|
| @@ -273,11 +273,14 @@ class InstanceMemberInferrer {
|
| if (element.kind == ElementKind.GETTER) {
|
| (element as ExecutableElementImpl).returnType = typeResult.type;
|
| } else if (element.kind == ElementKind.SETTER) {
|
| - var parameter = element.parameters[0] as ParameterElementImpl;
|
| - if (parameter.hasImplicitType) {
|
| - parameter.type = typeResult.type;
|
| + List<ParameterElement> parameters = element.parameters;
|
| + if (parameters.isNotEmpty) {
|
| + var parameter = parameters[0] as ParameterElementImpl;
|
| + if (parameter.hasImplicitType) {
|
| + parameter.type = typeResult.type;
|
| + }
|
| + parameter.inheritsCovariant = typeResult.isCovariant;
|
| }
|
| - parameter.inheritsCovariant = typeResult.isCovariant;
|
| }
|
| setFieldType(element.variable, typeResult.type);
|
| }
|
|
|