Skip to content

cmd/compile: include generic type when reporting inline function from go compiler #80433

Description

@Kentzo

What version of Go, VS Code & VS Code Go extension are you using?

Version Information
  • Run go version to get version of Go from the VS Code integrated terminal.
    • go version go1.26.3 darwin/arm64
  • Run gopls -v version to get version of Gopls from the VS Code integrated terminal.
    • golang.org/x/tools/gopls v0.22.0
  • Run code -v or code-insiders -v to get version of VS Code or VS Code Insiders.
    • 1.126.0
  • Check your installed extensions to get the version of the VS Code Go extension
    • 0.54.0

Describe the bug

Hint with inlining cost for generic function does not disambiguate costs assigned to dictionary-shaped and shape-stenciled versions, see screenshot. In the compiler output the distinction is clear:

  • ./builder.go:144:6: cannot inline writeFixedLenTLV[go.shape.struct { InactivityTimeout uint32; KeepAliveInterval uint32 }]: function too complex: cost 329 exceeds budget 80
  • ./builder.go:144:6: can inline writeFixedLenTLV[github.com/coredns/coredns/plugin/dso/internal/dsomessage.KeepAlive] with cost 73 as: func(*Builder, KeepAlive) (int, error) { return .autotmp_4, .autotmp_5 }

Steps to reproduce the behavior:

  1. Enable compiler optimization details
  2. See hint added to a generic function.

Screenshots or recordings

Image

Metadata

Metadata

Assignees

Labels

NeedsDecisionFeedback is required from experts, contributors, and/or the community before a change can be made.compiler/runtimeIssues related to the Go compiler and/or runtime.

Type

No type

Projects

Status
Todo

Relationships

None yet

Development

No branches or pull requests

Issue actions