Don't crash on type switch of untyped value.
From-SVN: r170456
This commit is contained in:
parent
6540ddba79
commit
acabc10c98
1 changed files with 5 additions and 1 deletions
|
@ -3911,7 +3911,11 @@ Type_switch_statement::do_lower(Gogo*, Block* enclosing)
|
|||
if (val_type->is_nil_type())
|
||||
rhs = Expression::make_nil(loc);
|
||||
else
|
||||
rhs = Expression::make_type_descriptor(val_type, loc);
|
||||
{
|
||||
if (val_type->is_abstract())
|
||||
val_type = val_type->make_non_abstract_type();
|
||||
rhs = Expression::make_type_descriptor(val_type, loc);
|
||||
}
|
||||
Statement* s = Statement::make_assignment(lhs, rhs, loc);
|
||||
b->add_statement(s);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue