Skip to content

x/tools/internal/refactor/inline: support inlining functions with type parameters #68236

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
lfolger opened this issue Jun 28, 2024 · 2 comments
Assignees
Labels
FeatureRequest Issues asking for a new feature that does not need a proposal. gopls Issues related to the Go language server, gopls. NeedsFix The path to resolution is known, but the work has not been done. Refactoring Issues related to refactoring tools Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@lfolger
Copy link
Contributor

lfolger commented Jun 28, 2024

Functions with type parameters cannot be inlined at the moment.

This is a feature request to make it possible to inline functions with type parameters.

@lfolger lfolger added FeatureRequest Issues asking for a new feature that does not need a proposal. Tools This label describes issues relating to any tools in the x/tools repository. Refactoring Issues related to refactoring tools labels Jun 28, 2024
@gopherbot gopherbot added this to the Unreleased milestone Jun 28, 2024
@joedian joedian added the NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. label Jun 28, 2024
@findleyr findleyr added NeedsFix The path to resolution is known, but the work has not been done. and removed NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. labels Jun 28, 2024
@findleyr findleyr modified the milestones: Unreleased, gopls/backlog Nov 22, 2024
@findleyr findleyr added the gopls Issues related to the Go language server, gopls. label Nov 22, 2024
@findleyr findleyr self-assigned this Nov 25, 2024
@findleyr findleyr modified the milestones: gopls/backlog, gopls/v0.18.0 Nov 25, 2024
@findleyr findleyr modified the milestones: gopls/v0.18.0, gopls/v0.19.0 Feb 6, 2025
@adonovan adonovan assigned jba and unassigned findleyr Feb 28, 2025
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/653436 mentions this issue: maps,slices: add //go:fix inline annotations for std namesakes

gopherbot pushed a commit to golang/exp that referenced this issue Feb 28, 2025
The tooling will not yet offer to inline calls to these functions
because it doesn't handle generics (golang/go#68236), but it
will soon.

Updates golang/go#32816

Change-Id: Ic19940efddab6267ca92f670ddc2f8029bc93402
Reviewed-on: https://go-review.googlesource.com/c/exp/+/653436
Auto-Submit: Alan Donovan <[email protected]>
Reviewed-by: Ian Lance Taylor <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/666716 mentions this issue: internal/refactor/inline: handle generic functions

gopherbot pushed a commit to golang/tools that referenced this issue Apr 22, 2025
This CL is a first step towards support for inlining all forms
of generic functions. Its limitations include:

- No support for methods on generic types.
- Conservative shadowing.
- Unnecessary type conversions (see generic.txtar, a1).
- Conservative parenthesizing (see generic.txtar, file a1a).

For golang/go#68236.

Change-Id: Ib00b89cb61c611e8d1efd0e2f8b5d93032638b83
Reviewed-on: https://go-review.googlesource.com/c/tools/+/666716
LUCI-TryBot-Result: Go LUCI <[email protected]>
Reviewed-by: Alan Donovan <[email protected]>
@adonovan adonovan modified the milestones: gopls/v0.19.0, gopls/backlog Apr 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FeatureRequest Issues asking for a new feature that does not need a proposal. gopls Issues related to the Go language server, gopls. NeedsFix The path to resolution is known, but the work has not been done. Refactoring Issues related to refactoring tools Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

6 participants