Area-CompilersBugConcept-APILanguage-VBhelp wanted
Description
Version Used: 1.2.2
Steps to Reproduce:
-
Have the following piece of code in your sample VB.NET solution (lets call
{1, 2}initExpr):Dim a = {1, 2} -
setup roslyn code analysis solution and try to get type of
initExprsyntax node using:var type = model.GetTypeInfo(initExpr).Typewhere
modelisSemanticModelof document whereinitExprresides, -
observe
typeisnull
Expected Behavior:
Type of initExpr should be Integer()
Actual Behavior:
Type of initExpr is null
Why?
- above approach to get type info works just fine in C# for implicitly typed arrays such as
new[] {1, 2}, - putting cursor over a variable
ain Visual Studio correctly shows it is of typeInteger()so the type is obviously known and should be returned when trying to access it viaGetSymbolInfomethod.
Issue initially described at StackOverflow.