Skip to content

Conversation

@axlee484
Copy link

Summary

Fixes #49691

- Fixing typo mentioned in [This Issue](dotnet#49691) where example for CLS compliance might be confusing. 

- As checked this is fine for the VB example the C# example needs update
@axlee484 axlee484 requested review from a team, BillWagner and IEvangelist as code owners November 16, 2025 18:09
@dotnetrepoman dotnetrepoman bot added this to the November 2025 milestone Nov 16, 2025
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates PR is created by someone from the .NET community. label Nov 16, 2025
Copy link
Member

@BillWagner BillWagner left a comment

Choose a reason for hiding this comment

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

Hi @axlee484

This needs another change for it to compile correctly. (It's also an old sample that's outside of our build system) The suggested change is needed. If adding a project file is easy, that would be great as well.

public class Person
{
private Int16 personAge = 0;
private UInt16 personAge = 0;
Copy link
Member

Choose a reason for hiding this comment

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

On line 11, a cast is needed (no suggestion, because that line wasn't changed). While here, let's simplify this as well:

public Int16 Age => (Int16)personAge;

Also, the snippets build is failing because there isn't a project file in this folder. If it's easy, can you add a project file in this folder? (This looks like old samples that were imported from a different system, so that may require a lot more work than this PR should add)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-contribution Indicates PR is created by someone from the .NET community.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Typo in field's CLS compliance example

2 participants