Skip to content

Conversation

@sbomer
Copy link
Member

@sbomer sbomer commented Jul 25, 2022

This adds tests for some edge cases due to the analyzer not treating captured parameters as hoisted variables like the linker does. See dotnet/runtime#117171 for a description of the differences.

@sbomer sbomer merged commit 145f0d2 into dotnet:main Jul 26, 2022
agocke pushed a commit to dotnet/runtime that referenced this pull request Nov 16, 2022
Add tests for some edge cases due to the analyzer not treating
captured parameters as hoisted variables like the linker does.

Currently the analyzer doesn't detect hoisted parameters, and it
will treat them like normal parameters - warning if a parameter
is assigned a value with an annotation that doesn't match the
parameter annotation. The linker will treat captured parameters
the same as other captured variables, tracking all values that
get assigned. So there is a subtle difference in the warning
behavior:

- Linker won't warn on assignment to annotated captured
  parameter, but analyzer will.

- Linker will produce dataflow warnings for all values assigned
  to a captured parameter, but analyzer will not.


Commit migrated from dotnet/linker@145f0d2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants