-
Notifications
You must be signed in to change notification settings - Fork 162
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
Default @GenerateMocks and custom @GenerateMocks has different returns (Generics to dynamic) #422
Comments
I'm using hive ^2.0.4 dependency |
Thanks for the bug report. Please include the four errors reported. |
|
Curious, can you send me the code for |
Also can you include your |
I can reproduce this bug with a little example. |
|
I don't know if this test works, here is the example that i'm using for my application:
|
The problem here is that this line: Mockito might be able to distinguish between an implicit type instantiation here (i.e. missing type argument(s)) and an explicit type instantiation. But to solve your problem today, you may need to declare a custom mock for each type of MockSpec<Box<int>>(as: #BoxSpyOfInt),
MockSpec<Box<String>>(as: #BoxSpyOfString), |
The strange is when i put the same Box in default code generator doesn't occur the problem like this code:
The test runs succesfully. Well, thanks for reply. =) |
Yeah this is an ugly (IMO) wrinkle in the language. |
… "custom mock" annotation with implicit type arguments. Given a method which references type variables defined on their enclosing class (for example, `T` in `class Foo<T>`), mockito will now correctly reference `T` in generated code. Fixes #422 PiperOrigin-RevId: 377571931
… "custom mock" annotation with implicit type arguments. Given a method which references type variables defined on their enclosing class (for example, `T` in `class Foo<T>`), mockito will now correctly reference `T` in generated code. Fixes #422 PiperOrigin-RevId: 377571931
… "custom mock" annotation with implicit type arguments. Given a method which references type variables defined on their enclosing class (for example, `T` in `class Foo<T>`), mockito will now correctly reference `T` in generated code. Fixes #422 PiperOrigin-RevId: 377571931
Hi, i'm using the custom mocks, but when i run the build_runner the vscode found 4 problems in generated code. But when i use the default mocks the error doesn't occur.
Here is the custom generate code:
The default generate code:
The text was updated successfully, but these errors were encountered: