Skip to content
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

Update TypeTestingAndConversionOperators.cs #40240

Merged
merged 2 commits into from
Mar 28, 2024
Merged

Conversation

Xamarin2019
Copy link
Contributor

Fixed code snippet for array casting example.
image

Now it works in browser.

Summary

Checking the code in the browser raised an error.

I'm happy to help Microsoft!

Fixed code snippet for array casting example.
Now it works in browser.
@dotnet-bot dotnet-bot added this to the March 2024 milestone Mar 28, 2024
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates PR is created by someone from the .NET community. label Mar 28, 2024
@Xamarin2019
Copy link
Contributor Author

Dear team!
I think you need unit tests for code samples.
image

@BillWagner
Copy link
Member

closing and reopening for a fresh CI build.

@BillWagner BillWagner closed this Mar 28, 2024
@BillWagner BillWagner reopened this Mar 28, 2024
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.

Thanks @Xamarin2019

This LGTM, and I'll :shipit: as soon as the build finishes.

@BillWagner BillWagner enabled auto-merge (squash) March 28, 2024 14:06
@BillWagner
Copy link
Member

Dear team! I think you need unit tests for code samples.

We know. It's a harder problem than it appears at first.

Most importantly, we don't want the introduction of unit tests to make the reader's experience worse. For example, it's easy to copy / paste / modify samples that use Console.WriteLine to experiment with an API or a concept. Those are hard to unit test, and brittle when you do. We're working on some technology that would enable us to "replay" the steps for code in an article and verify the results. Those show promise, but aren't perfect yet.

In the meantime, we have a CI system to (at least) catch compiler errors.

@BillWagner BillWagner merged commit 9a03b4a into dotnet:main Mar 28, 2024
7 checks passed
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. dotnet-csharp/svc lang-reference/subsvc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants