-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Escape analysis ignores local passed by reference to interpolated string handler AppendFormatted()
method
#63306
Comments
In this bit, it seems like we weren't precisely correct in our assumptions on how the calls within interpolated string conversions could be formed. An unscoped in-parameter could come in here which we don't handle properly: roslyn/src/Compilers/CSharp/Portable/Binder/Binder.ValueChecks.cs Lines 4131 to 4135 in 3a17b7b
I think we could avoid entirely making assumptions about the shape of the call here, and instead just pass it through the appropriate general purpose helper for calls (GetInvocationArgumentsForEscape or GetInvocationArgumentsForEscapeWithUpdatedRules in #62886). Another layer may be synthesizing the call within some limited set of constraints, but it doesn't matter to the escape analysis layer. |
This is no longer a bug because the |
The bug still exists, see #75802 (comment). I'm working on a fix. |
Expected:
Escape analysis should report errors for the conversions from interpolated string to
CustomHandler
since a reference to the local is potentially returned to the calling method.Actual:
No errors.
The text was updated successfully, but these errors were encountered: