Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

vitek-karas
Copy link
Member

@vitek-karas vitek-karas commented Jan 16, 2023

The warning needs to be generated from the origin where the field reference comes from - so if it's a method body, then from the method body. This is because the instantiation is determined by that place, not the field itself (the field is defined on an open generic definition of the type).

This syncs the relevants tests with a NativeAOT work-in-progress change, but in generately it adds a lot more cases and some better comments.

…ss on generic type

The warning needs to be generated from the origin where the field reference comes from - so if it's a method body, then from the method body. This is because the instantiation is determined by that place, not the field itself (the field is defined on an open generic definition of the type).

This syncs the relevants tests with a NativeAOT work-in-progress change, but in generately it adds a lot more cases and some better comments.
@vitek-karas vitek-karas added this to the .NET 8.0 milestone Jan 16, 2023
@vitek-karas vitek-karas requested a review from tlakollo January 16, 2023 19:22
@vitek-karas vitek-karas self-assigned this Jan 16, 2023
@vitek-karas vitek-karas changed the title Fix a small bug in message origin for warnings from static field acce… Fix a small bug in message origin for warnings from static field access on generic type Jan 16, 2023
Copy link
Contributor

@tlakollo tlakollo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor spelling stuff, LGTM

Co-authored-by: Tlakaelel Axayakatl Ceja <[email protected]>
@vitek-karas vitek-karas merged commit c790896 into dotnet:main Jan 17, 2023
@vitek-karas vitek-karas deleted the FieldOnGenericAccessTest branch January 17, 2023 18:16
tlakollo pushed a commit to tlakollo/runtime that referenced this pull request Jan 31, 2023
…ss on generic type (dotnet/linker#3186)

The warning needs to be generated from the origin where the field reference comes from - so if it's a method body, then from the method body. This is because the instantiation is determined by that place, not the field itself (the field is defined on an open generic definition of the type).

This syncs the relevants tests with a NativeAOT work-in-progress change, but in generately it adds a lot more cases and some better comments.

Co-authored-by: Tlakaelel Axayakatl Ceja <[email protected]>

Commit migrated from dotnet/linker@c790896
tlakollo pushed a commit to tlakollo/runtime that referenced this pull request Jan 31, 2023
…ss on generic type (dotnet/linker#3186)

The warning needs to be generated from the origin where the field reference comes from - so if it's a method body, then from the method body. This is because the instantiation is determined by that place, not the field itself (the field is defined on an open generic definition of the type).

This syncs the relevants tests with a NativeAOT work-in-progress change, but in generately it adds a lot more cases and some better comments.

Co-authored-by: Tlakaelel Axayakatl Ceja <[email protected]>

Commit migrated from dotnet/linker@c790896
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants