The following example gives the error message "expected value of type
'bits<32>', got 'bit'" on the assignment.
class Instruction { bits<32> encoding; } def foo: Instruction { let encoding{10} = !eq(0, 1); }
But there's nothing wrong with this code: 'bit' is a perfectly good
type for the RHS of an assignment to a single bit of an
instruction encoding.
The problem is that ParseBodyItem is accidentally type-checking the
RHS against the full type of the encoding field, without adjusting
it in the case where we're only assigning to a subset of the bits. The
fix is trivial.