proposal: allow to use concrete struct for func interface type parameters #37717
Labels
FrozenDueToAge
LanguageChange
Proposal
Proposal-FinalCommentPeriod
v2
A language change or incompatible library change
Milestone
First that comes to mind is such signature.
Library:
Library consumer:
Since proto.Message is interface and MyProtoMessage implements it I can pass it to Publish without any problem and do marshal internally. But there are few problems with Subscribe:
My proposal is to make such Go code compile.
When reflection can be used to get concrete type from such handler parameters and would solve both issues.
Example from valid Typescript with a use of
any
type.The text was updated successfully, but these errors were encountered: