Fix gettype unbound generics 1958760587701317988#1230
Draft
GrahamTheCoder wants to merge 3 commits intoicsharpcode:masterfrom
Draft
Fix gettype unbound generics 1958760587701317988#1230GrahamTheCoder wants to merge 3 commits intoicsharpcode:masterfrom
GrahamTheCoder wants to merge 3 commits intoicsharpcode:masterfrom
Conversation
VB open generics like `Nullable(Of )` generate `IErrorTypeSymbol` when using Roslyn's semantic model which previously forced `TypeConversionAnalyzer` and equality comparisons to fall back to `object` instead of preserving the syntax tree representing `typeof(X<>)`. This patch correctly yields `OmittedTypeArgumentSyntax` and bypasses the `System.Object` coercion fallback for equality testing. Co-authored-by: GrahamTheCoder <2490482+GrahamTheCoder@users.noreply.github.com>
…e(Of)) Roslyn's Simplifier.Expand replaces missing type arguments (open generics like Nullable(Of)) with an error type fallback (Object), causing GetType(Nullable(Of)) to incorrectly convert to typeof(object) instead of typeof(Nullable<>). Guard against this in NameCanBeExpanded by detecting GenericNameSyntax nodes with missing type arguments and skipping expansion, preserving the open generic form so the conversion visitors can correctly emit OmittedTypeArgument. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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 issue #1165 where
GetType(Nullable(Of))incorrectly translates totypeof(object)instead oftypeof(Nullable<>).There seems to be an upstream bug in the roslyn expander that turns
Nullable(Of)intoNullable(Of Object). We'll work around it here.PR created from Jules task 1958760587701317988 started by @GrahamTheCoder and a follow up claude code session