Skip to content

x/tools: support for type-inferred composite literals #82039

Open

Description

@adonovan

[Update: only gopls' inline and extract operations still need addressing. -- adonovan, Oct 20]

Now that #12854 has been accepted for Go 1.28, we need to ensure that all of x/tools (incl. gopls) is able to handle non-nested ast.CompositeLit nodes that lack an explicit type.

The following packages mention ast.CompositeLit and are thus a likely upper bound for the audit:

go/analysis/passes/composite
go/analysis/passes/copylock
go/analysis/passes/modernize
go/analysis/passes/reflectvaluecompare
go/ast/astutil
go/ast/edge
go/ast/inspector
go/ssa
gopls/internal/analysis/fillstruct
gopls/internal/analysis/ptrtoerror
gopls/internal/analysis/simplifycompositelit
gopls/internal/cache/parsego
gopls/internal/cache/typerefs
gopls/internal/golang
gopls/internal/golang/completion
gopls/internal/test/marker/testdata/codeaction
gopls/internal/util/typesutil
internal/astutil
internal/astutil/free
internal/refactor/inline
internal/stdlib
internal/typesinternal
refactor/eg
refactor/rename
refactor/satisfy

Activity

  1. self-assigned this
    on Oct 6, 2026
  2. added this to the Go1.28 milestone on Oct 6, 2026
  3. added
    ToolsThis label describes issues relating to any tools in the x/tools repository.
    on Oct 6, 2026
  4. gopherbot commented on Oct 7, 2026

    @gopherbot
    Contributor

    Change https://go.dev/cl/846693 mentions this issue: gopls/internal/golang: undeclared: reject ill-typed arguments

  5. gopherbot commented on Oct 7, 2026

    @gopherbot
    Contributor

    Change https://go.dev/cl/846688 mentions this issue: internal/refactor/inline: handle untyped composite literals

  6. gopherbot commented on Oct 7, 2026

    @gopherbot
    Contributor

    Change https://go.dev/cl/846687 mentions this issue: go/analysis/passes/modernize: newexpr: reject untyped composite literals

  7. gopherbot commented on Oct 7, 2026

    @gopherbot
    Contributor

    Change https://go.dev/cl/846691 mentions this issue: refactor/eg: compare types of composite literals with implicit types

  8. gopherbot commented on Oct 7, 2026

    @gopherbot
  9. gopherbot commented on Oct 7, 2026

    @gopherbot
  10. gopherbot commented on Oct 7, 2026

    @gopherbot
    Contributor

    Change https://go.dev/cl/846686 mentions this issue: go/ssa: support pointer-typed composite literals in all contexts

  11. gopherbot commented on Oct 7, 2026

    @gopherbot
    Contributor

    Change https://go.dev/cl/846692 mentions this issue: gopls/internal/analysis/ptrtoerror: handle pointer-typed composite literals

  12. gopherbot commented on Oct 14, 2026

    @gopherbot
    Contributor

    Change https://go.dev/cl/848309 mentions this issue: internal/refactor/inline: add failing tests for go1.28 inferred {...} literals

  13. gopherbot commented on Oct 14, 2026

    @gopherbot
    Contributor

    Change https://go.dev/cl/848310 mentions this issue: internal/refactor/inline: type inferred comp lit returns assigned to blank or interface

  14. gopherbot commented on Oct 14, 2026

    @gopherbot
    Contributor

    Change https://go.dev/cl/848314 mentions this issue: internal/refactor/inline: type inferred comp lit args discarded in empty func

  15. gopherbot commented on Oct 14, 2026

    @gopherbot
    Contributor

    Change https://go.dev/cl/848312 mentions this issue: internal/refactor/inline: type inferred comp lit returns discarded in stmt context

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

ToolsThis label describes issues relating to any tools in the x/tools repository.

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions