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
Cannot mock function returning nullable value class #813
Comments
Bump for visibility, especially now that duration has been released officially in 1.6, the usage of nullable value classes will grow. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. If you are sure that this issue is important and should not be marked as |
Hey, any update on the issue? |
Seems like this issue now applies for non-nullable value classes as of 1.13.10
|
Expected Behavior
Being able to mock functions returning nullable
value class
es.Current Behavior
It's possible to mock functions returning
value class
es, but only if they return a non-null value. Otherwise an exception is thrown while trying to execute theevery
statement.Failure Information (for bugs)
Steps to Reproduce
Create a class with a function that returns a nullable
value
class (e.g.,fun getInstance(): TestValueClass?
) and try to mock itsgetInstance()
call.Note that
fun getInstance(): TestValueClass
(without?
) can be mocked successfully.Context
Stack trace
Minimal reproducible code (the gist of this issue)
Sidenote
I realise that #152 also discussed
value class
es, but as part of that issue it seems main support has been added. (Thank you for that.) As such this seemed more like a separate issue and worth a dedicated bug report. Feel free to merge if this should be part of that issue instead.The text was updated successfully, but these errors were encountered: