-
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
Fix error on out param of extern local function #49860
Conversation
@@ -58,6 +58,12 @@ protected TLocalFunctionState GetOrCreateLocalFuncUsages(LocalFunctionSymbol loc | |||
|
|||
public override BoundNode? VisitLocalFunctionStatement(BoundLocalFunctionStatement localFunc) | |||
{ | |||
if (localFunc.Symbol.IsExtern) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
localFunc.Symbol.IsExtern [](start = 16, length = 25)
Does this match the criteria used to skip analysis for type members (non-local functions)? Would it make sense to check for presence of the body instead? #Closed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found that for member methods, we decide whether to analyze based on whether BindMethodBody returned a non-null body. extern
member methods will force a null
return from BindMethodBody, which makes us skip analysis even in an error scenario where an extern method has a body.
I didn't want to modify the conditions when a BoundLocalFunctionStatement is given a null
body, in order to reduce churn, and felt that this check resulted in useful diagnostic behaviors (i.e. if the function is required to have a body but one is missing, we might as well also let you know about things that are required to be included in that body), which are consistent enough with the diagnostics given for member methods.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM (commit 2)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM Thanks (iteration 2)
* upstream/master: (241 commits) Allow pattern matching `null` against pointer types when the pointer types contain nested type parameters (dotnet#49915) Remove document extension method and convert usages to use the text buffer extension method. VB: Strengthen implementation of `PropertySymbol.IsWritable` against NullReferenceException (dotnet#49962) Add switch to skip nullable analysis (dotnet#49876) Update dependencies from https://github.com/dotnet/roslyn build 20201211.16 (dotnet#49958) Treat record positional parameters as properties (dotnet#48329) [master] Update dependencies from dotnet/roslyn (dotnet#49395) VB: Ensure array access indexes undergo conversion to integer even when there is a mismatch with array rank. (dotnet#49907) Disable OOP when running as cloud environment client VS instance Rename workspace context method (and unify impls) to better represent the condition being checked Report non-Const locals used in an expression that must have a constant value. (dotnet#49912) Add support for more ServiceAudience values (dotnet#49914) Handle ref-containing structs returned by value from function-pointers (dotnet#49883) Fix error on out param of extern local function (dotnet#49860) Fix constructor exit warnings for generic NotNull (dotnet#49841) Loc updates Prefer more specific path map key (dotnet#49670) Rename `_availablelocalFunctionOrdinal` to `_availableLocalFunctionOrdinal` (dotnet#49901) Fix namespace so that external access wrapper type can be accessed from UT. XamlProjectService fixes (dotnet#49711) ...
Closes #49500