Claude/fix issue 892 char empty comparison#1256
Draft
GrahamTheCoder wants to merge 3 commits intoicsharpcode:masterfrom
Draft
Claude/fix issue 892 char empty comparison#1256GrahamTheCoder wants to merge 3 commits intoicsharpcode:masterfrom
GrahamTheCoder wants to merge 3 commits intoicsharpcode:masterfrom
Conversation
Map VB.NET char comparison with an empty string to char.MinValue to match runtime behavior and prevent logic errors during compilation. Added a unit test. Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Map VB.NET char comparison with an empty string to char.MinValue to match runtime behavior and prevent logic errors during compilation. For `Option Compare Text`, map it appropriately using `Microsoft.VisualBasic.CompilerServices.Conversions.ToString` to prevent `char` being compared to an empty string. Added characterization tests. Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
…omparison fix Remove leftover patch artifacts (.orig, .rej, patch file) and temporary TestDotNet debugging files that were committed by mistake. Expand the regression test to also cover the not-equal (<>) operator case. https://claude.ai/code/session_01AkwUvu3XuCdj3D4axoX4UX
GrahamTheCoder
commented
Apr 13, 2026
| ((lhsTypeInfo.Type?.SpecialType == SpecialType.System_Char && rhsTypeInfo.Type?.SpecialType == SpecialType.System_String && _visualBasicEqualityComparison.IsNothingOrEmpty(node.Right)) || | ||
| (rhsTypeInfo.Type?.SpecialType == SpecialType.System_Char && lhsTypeInfo.Type?.SpecialType == SpecialType.System_String && _visualBasicEqualityComparison.IsNothingOrEmpty(node.Left)))) { | ||
| if (lhsTypeInfo.Type?.SpecialType == SpecialType.System_Char) { | ||
| rhs = CS.SyntaxFactory.MemberAccessExpression(CS.SyntaxKind.SimpleMemberAccessExpression, CS.SyntaxFactory.PredefinedType(CS.SyntaxFactory.Token(CS.SyntaxKind.CharKeyword)), CS.SyntaxFactory.IdentifierName("MinValue")); |
Member
Author
There was a problem hiding this comment.
Look like a hack to make the specific test case work rather than the general fix to the root cause
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #892