Skip to content
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

ExplicitMode incorrectly caches methods across builds #102

Closed
timotei opened this issue Mar 28, 2018 · 0 comments
Closed

ExplicitMode incorrectly caches methods across builds #102

timotei opened this issue Mar 28, 2018 · 0 comments
Milestone

Comments

@timotei
Copy link

timotei commented Mar 28, 2018

Hello,

It seems that across application rebuilds, the cache that is being done inside the
ExplicitMode.memberNullabilityCache dictionary is not properly handled. Basically, if for example move the [NotNull] attribute from a parameter to another, it won't be seen so the generated code is wrong. All the issue stems from the fact that we have that case static, and apparently it's kept in memory across rebuilds.

The steps to reproduce are:

  • Open the sample
  • Compile and check the diassembly
  • Move the NotNull attribute to another parameter, keeping the other things intact
  • Verify the disassembly again and see that while the NotNull attribute placement has moved, the null-guard wasn't updated.

Initial version:
first_version

After moving the NotNull:
second_version

Here's the sample:
DryIocPoc.zip

A potential fix (probably best fix) would be to get rid of the static usage and use instances instead.

timotei referenced this issue Mar 28, 2018
* Introduce "Explicit" mode
* Duplicate and adapt tests for explicit mode
* Support inheritance and external annotations.
@SimonCropp SimonCropp added this to the 1.8.0 milestone Apr 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants