Closed as duplicate of#50285
Description
Proposal Details
Take the following example. I think the compiler should be able to infer T=string.
func generic[T any]() (t T) {
return
}
func hello() string {
return generic() // Currently Error: Cannot infer T
}
Other languages like TypeScript and Java will infer the type-argument by the return signature.