Skip to content

Sample code does not compile; methods outside of class definition #11109

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

Open
steveharter opened this issue Mar 20, 2025 · 1 comment
Open

Sample code does not compile; methods outside of class definition #11109

steveharter opened this issue Mar 20, 2025 · 1 comment
Labels
area-System.Runtime untriaged New issue has not been triaged by the area owner

Comments

@steveharter
Copy link
Member

Type of issue

Typo

Description

There are several methods including public void CallStaticPrivateMethod() that don't belong to a class and thus won't compile.

If the intent is to show that this code should be somewhere else, such as generated code, then a wrapper class of some sort should be provided so at least the sample code compiles.

Page URL

https://learn.microsoft.com/en-us/dotnet/api/system.runtime.compilerservices.unsafeaccessorattribute?view=net-9.0&source=docs

Content source URL

https://github.com/dotnet/dotnet-api-docs/blob/main/xml/System.Runtime.CompilerServices/UnsafeAccessorAttribute.xml

Document Version Independent Id

d8b3e8e8-a5e1-1884-99f2-678cf6a77a45

Platform Id

cbce44e6-89f0-7d37-b0fd-cb328dfbdd90

Article author

@dotnet-bot

@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged by the area owner label Mar 20, 2025
Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-system-runtime

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-System.Runtime untriaged New issue has not been triaged by the area owner
Projects
None yet
Development

No branches or pull requests

1 participant