Skip to content

Replace usage of operator as by is pattern matching#296

Merged
BCSharp merged 1 commit intoIronLanguages:mainfrom
BCSharp:as_to_is
Feb 26, 2026
Merged

Replace usage of operator as by is pattern matching#296
BCSharp merged 1 commit intoIronLanguages:mainfrom
BCSharp:as_to_is

Conversation

@BCSharp
Copy link
Member

@BCSharp BCSharp commented Feb 26, 2026

It appears that the IL code is the same, so it is mostly readability and style change.

Copy link
Contributor

@slozier slozier left a comment

Choose a reason for hiding this comment

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

Thanks!

PropertyInfo property;

if ((method = member as MethodInfo) != null) {
if (member is MethodInfo method) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Not really the change at hand, but this one is a good candidate for pattern matching with a switch expression...

Copy link
Member Author

Choose a reason for hiding this comment

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

Agree. There are more places like this. Prefer to have a separate PR for these changes, to keep the Git history clean.

@BCSharp BCSharp merged commit a74a504 into IronLanguages:main Feb 26, 2026
8 checks passed
@BCSharp BCSharp deleted the as_to_is branch February 26, 2026 22:26
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