Skip to content

proposal: go/types: assign non-untyped types for all runtime expressions #62466

Open
@mdempsky

Description

@mdempsky

Compilers like cmd/compile and x/tools/go/ssa prefer to work exclusively with true types, but there are several cases where go/types leaves expressions as untyped:

func idealType(tv syntax.TypeAndValue) types2.Type {

It would be convenient if go/types were to provide appropriate true types for each of these contexts, since it's already having to check that the untyped expressions are suitable.

Related: #47151 proposes adding a second map for the implicitly converted type of expressions. I'd suggest that's a reasonable way to avoid breaking users that expect the current untyped types (e.g., #47243).

/cc @griesemer @findleyr @alandonovan

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Incoming

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions