File tree 2 files changed +9
-8
lines changed
2 files changed +9
-8
lines changed Original file line number Diff line number Diff line change 1
- 9ae5835a010a55fba875103be5f4e61485a97099
1
+ 3aa2ea272e475010da8b480fc3095d0cd7254d12
2
2
3
3
The first line of this file holds the git revision number of the last
4
4
merge done from the gofrontend repository.
Original file line number Diff line number Diff line change @@ -3156,6 +3156,7 @@ Check_types_traverse::variable(Named_object* named_object)
3156
3156
error_at (var->location (),
3157
3157
" incompatible type in initialization (%s)" ,
3158
3158
reason.c_str ());
3159
+ init = Expression::make_error (named_object->location ());
3159
3160
var->clear_init ();
3160
3161
}
3161
3162
else if (init != NULL
@@ -3180,13 +3181,13 @@ Check_types_traverse::variable(Named_object* named_object)
3180
3181
no->message_name ().c_str ());
3181
3182
}
3182
3183
}
3183
- else if (!var->is_used ()
3184
- && !var->is_global ()
3185
- && !var->is_parameter ()
3186
- && !var->is_receiver ()
3187
- && !var->type ()->is_error ()
3188
- && (init == NULL || !init->is_error_expression ())
3189
- && !Lex::is_invalid_identifier (named_object->name ()))
3184
+ if (!var->is_used ()
3185
+ && !var->is_global ()
3186
+ && !var->is_parameter ()
3187
+ && !var->is_receiver ()
3188
+ && !var->type ()->is_error ()
3189
+ && (init == NULL || !init->is_error_expression ())
3190
+ && !Lex::is_invalid_identifier (named_object->name ()))
3190
3191
error_at (var->location (), " %qs declared and not used" ,
3191
3192
named_object->message_name ().c_str ());
3192
3193
}
You can’t perform that action at this time.
0 commit comments