Skip to content

Commit 95d0021

Browse files
committed
check the type
1 parent 7855014 commit 95d0021

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

rlp/rlpgen/gen.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,10 @@ func (bctx *buildContext) makeNamedBasicOp(named *types.Named) (op, error) {
387387
}
388388

389389
// Cast to basicOp and modify the typ field to use the named type
390-
op := baseOp.(basicOp)
390+
op, ok := baseOp.(basicOp)
391+
if !ok {
392+
return nil, fmt.Errorf("expected basicOp, got %T", baseOp)
393+
}
391394
op.typ = named // Use the named type as the main type instead of the underlying basic type
392395

393396
// For decoding, we want to decode as the underlying basic type and convert to named type

0 commit comments

Comments
 (0)