-
-
Notifications
You must be signed in to change notification settings - Fork 70
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
Parent method with static type, has a badly evaluated return type for factory method in container #295
Comments
dg
added a commit
to nette/union
that referenced
this issue
Sep 26, 2023
dg
added a commit
to nette/utils
that referenced
this issue
Sep 27, 2023
dg
added a commit
to nette/union
that referenced
this issue
Oct 9, 2023
dg
added a commit
to nette/union
that referenced
this issue
Oct 17, 2023
dg
added a commit
to nette/union
that referenced
this issue
Oct 25, 2023
dg
added a commit
to nette/utils
that referenced
this issue
Oct 29, 2023
dg
added a commit
to nette/union
that referenced
this issue
Nov 2, 2023
dg
added a commit
to nette/union
that referenced
this issue
Nov 3, 2023
dg
added a commit
to nette/union
that referenced
this issue
May 28, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Version: v3.1.3
Bug Description
If i extends class, where parent has method with self or static return type. I use this method for a single line notation, then in container is returned type of parent instead my class. I get exception
Service of type Ipsum: Service of type Bar required by $bar in Ipsum::__construct() not found. Did you add it to configuration file?
Steps To Reproduce
Classes for use case
Factory method in container:
Standard use
Factory method in container:
Expected Behavior
The returned type of method is type of my class.
Possible Solution
I try debugging and found Resolver.php#L116 where
$entity
is array ['Bar', 'any'] and returnedReflectionMethod
with classFoo
. If i fix it that second place Resolver.php#L133, where it is changed fromBar::any
toFoo::any
. I haven't context, knowlage and time to fix it.The text was updated successfully, but these errors were encountered: