Commit 78a1610
Fix VbNameExpander corrupting open generic types like GetType(Nullable(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>1 parent 4310d6e commit 78a1610
File tree
2 files changed
+5
-2
lines changed- CodeConverter/CSharp
- Tests/CSharp/ExpressionTests
2 files changed
+5
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
113 | 116 | | |
114 | 117 | | |
115 | 118 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
0 commit comments