Skip to content

cmd/api: does not handle shift by a types constant. #2907

@remyoudompheng

Description

@remyoudompheng
What steps will reproduce the problem?
1. Create a test package

package test

const Value uint = 1
const Flag = 1 << Value

2. Run "go tool api test"

What is the expected output? What do you see instead?

Expected:
pkg test, const Value uint
pkg test, const Flag ideal-int

Got:
unknown kind in const "Flag" (*ast.BinaryExpr): in BinaryExpr, unhandled type
mismatch; left="ideal-int", right="uint"

If I try to add handling of unexported constants to cmd/api, I run into:

unknown kind in const "bias64" (*ast.BinaryExpr): in BinaryExpr, unhandled
type mismatch; left="uint", right="ideal-int"

when analyzing runtime/softfloat64.go

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions