-
Couldn't load subscription status.
- Fork 18.4k
Open
Labels
ProposalProposal-HoldTypeInferenceIssue is related to generic type inferenceIssue is related to generic type inferencegenericsIssue is related to genericsIssue is related to generics
Milestone
Description
hope go could support infer generic type from variable type
func main() {
var x Person = get() // to replace var x = get[Person]()
fmt.Println(x)
}
func get[T any]() T {
var x T
return x
}
DeedleFake, thesyncim, yinchyu, aight8, bounoable and 42 moremlevieux and tooolboxsammy-hughes, AxXxB, kkqy, Tabaie, tsackit and 1 more
Metadata
Metadata
Assignees
Labels
ProposalProposal-HoldTypeInferenceIssue is related to generic type inferenceIssue is related to generic type inferencegenericsIssue is related to genericsIssue is related to generics
Type
Projects
Status
Hold