-
Notifications
You must be signed in to change notification settings - Fork 295
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Disallow using In/Out structs with From/As annotations (#1068)
In #1053, we eased up the requirement for function signature for applying annotations to allow using In/Out structs with ResultTags/ParamTags. This had an unintended change in behavior where users are now able to use In/Out structs with From/As annotations. For example, the below code used to error out: > type Foo interface { ... } > type Bar struct { ... } // Bar implements Foo > struct Res { > fx.Out > > ABar Bar > } > fx.Annotate( > func() Res { ... }, > fx.As(new(Foo)), > ) Currently the code above applies the As annotation to ABar field and transforms the target function's signature accordingly. However, this was an unintended change in behavior, and we should have a design discussion about whether we actually want this before cutting a new release. Since it will require a breaking change to disable this after a new release is cut, I think the safe approach is to disable this for now and enable it after having decided that this is indeed what we want. Fixes #1060 --------- Co-authored-by: Sung Yoon Whang <sungyoonwhang@gmail.com> Co-authored-by: JacobOaks <jacoboaks.8@gmail.com>
- Loading branch information
1 parent
195960b
commit 475cd1b
Showing
2 changed files
with
76 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters