-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
[hot reload] Mono needs to be more lax about CustomAttribute updates #57387
Comments
dotnet-issue-labeler
bot
added
the
untriaged
New issue has not been triaged by the area owner
label
Aug 14, 2021
Happens in Razor pages with a |
lambdageek
removed
the
untriaged
New issue has not been triaged by the area owner
label
Aug 14, 2021
lambdageek
added a commit
to lambdageek/runtime
that referenced
this issue
Aug 14, 2021
…tes. If the "type" (really .ctor) token is a MemberRef, it won't be literally the same token value in the update as in the baseline because Roslyn emits additional MemberRef, TypeRef and AssemblyRef rows instead of trying to reuse the baseline ones. We could try to resolve the baseline and delta tokens and check that they map to the same MonoMethod*, but that is problematic (it may trigger assembly loading and class initialization) and also unnecessary - without the ChangeCustomAttribute capability Roslyn will not allow edits that change the constructor or its arguments. So just drop the extra check. Fixes dotnet#57387
ghost
added
the
in-pr
There is an active PR which will close this issue when it is merged
label
Aug 14, 2021
ghost
removed
the
in-pr
There is an active PR which will close this issue when it is merged
label
Aug 14, 2021
lambdageek
added a commit
that referenced
this issue
Aug 14, 2021
…tes (#57388) * [hot_reload] Allow the .ctor token to change for CustomAttribute updates. If the "type" (really .ctor) token is a MemberRef, it won't be literally the same token value in the update as in the baseline because Roslyn emits additional MemberRef, TypeRef and AssemblyRef rows instead of trying to reuse the baseline ones. We could try to resolve the baseline and delta tokens and check that they map to the same MonoMethod*, but that is problematic (it may trigger assembly loading and class initialization) and also unnecessary - without the ChangeCustomAttribute capability Roslyn will not allow edits that change the constructor or its arguments. So just drop the extra check. Fixes #57387 * Add testcase
ghost
locked as resolved and limited conversation to collaborators
Sep 14, 2021
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The runtime accepts updates to a
CustomAttribute
row, as long as the parent and the "type" (really ctor) are "the same".But the check for whether the ctor is "the same" is too strict - it expects token equality. That works for MethodDef tokens, but not for MemberRef tokens, because Roslyn emits fresh MemberRef (and TypeRef and AssemblyRef) rows into the delta.
So the token for the new ctor is not literally the same as the token for the old ctor.
We should trust that Roslyn won't send us anything unexpected - which it does not because changing the ctor or its argument data requires the ChangeCustomAttributes capability, which mono doesn't provide).
This particularly affects
this
-capturing lambdas.Something like this:
Generates
The text was updated successfully, but these errors were encountered: