{"action":"opened","issue":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/7698","labels_url":"https://api.github.com/repos/dotnet/roslyn/issues/7698/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/roslyn/issues/7698/comments","events_url":"https://api.github.com/repos/dotnet/roslyn/issues/7698/events","html_url":"https://github.com/dotnet/roslyn/issues/7698","id":123838917,"number":7698,"title":"Wrong results from VB variable.type.tostring","user":{"login":"paul1956","id":12789369,"avatar_url":"https://avatars.githubusercontent.com/u/12789369?v=3","gravatar_id":"","url":"https://api.github.com/users/paul1956","html_url":"https://github.com/paul1956","followers_url":"https://api.github.com/users/paul1956/followers","following_url":"https://api.github.com/users/paul1956/following{/other_user}","gists_url":"https://api.github.com/users/paul1956/gists{/gist_id}","starred_url":"https://api.github.com/users/paul1956/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paul1956/subscriptions","organizations_url":"https://api.github.com/users/paul1956/orgs","repos_url":"https://api.github.com/users/paul1956/repos","events_url":"https://api.github.com/users/paul1956/events{/privacy}","received_events_url":"https://api.github.com/users/paul1956/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-12-24T23:23:51Z","updated_at":"2015-12-24T23:23:51Z","closed_at":null,"body":"I am looking to Analyze AbstractFlowPass.VB in Roslyn Source specifically the second line.\r\n```\r\nDim caseBlockStateBuilder = ArrayBuilder(Of LocalState).GetInstance(caseBlocks.Length)\r\n```\r\nI am trying to get the Type of ArrayBuilder(Of LocalState).GetInstance(caseBlocks.Length) which I believe is an ArrayBuilder(Of LocalState). using the Snippet of code below.\r\n```\r\nDim variableType As TypeInfo = Model.GetTypeInfo(lVariableDeclarator.Initializer.Value)\r\nDim expressionType As ITypeSymbol = variableTypeInfo.Type\r\n```\r\nThe variable expressionType contains the Type and looks perfect in the Immediate Window as it is a NamedType whose value is Microsoft.CodeAnalysis.ArrayBuilder(Of LocalState).\r\n```\r\n?expressionType\r\nNamedType Microsoft.CodeAnalysis.ArrayBuilder(Of LocalState)\r\n    AllInterfaces: Length = 4\r\n    Arity: 1\r\n    AssociatedSymbol: Nothing\r\n    BaseType: NamedType System.Object\r\n    CanBeReferencedByName: True\r\n    ConstructedFrom: NamedType Microsoft.CodeAnalysis.ArrayBuilder(Of T)\r\n    Constructors: Length = 2\r\n    ContainingAssembly: Assembly Microsoft.CodeAnalysis, Version=42.42.42.42, Culture=neutral, PublicKeyToken=31bf3856ad364e35\r\n    ContainingModule: NetModule Microsoft.CodeAnalysis.dll\r\n    ContainingNamespace: Namespace Microsoft.CodeAnalysis\r\n    ContainingSymbol: Namespace Microsoft.CodeAnalysis\r\n    ContainingType: Nothing\r\n    DeclaredAccessibility: Friend {4}\r\n    DeclaringSyntaxReferences: Length = 0\r\n    DefaultMarshallingCharSet: 'DirectCast(expressionType, Microsoft.CodeAnalysis.VisualBasic.Symbols.NamedTypeSymbol).DefaultMarshallingCharSet' threw an exception of type 'System.InvalidOperationException'\r\n    DelegateInvokeMethod: Nothing\r\n    EnumUnderlyingType: Nothing\r\n    HasUnsupportedMetadata: False\r\n    HighestPriorityUseSiteError: 30649\r\n    ISymbol_IsAbstract: False\r\n    ISymbol_IsSealed: True\r\n    ISymbol_IsStatic: False\r\n    InstanceConstructors: Length = 2\r\n    Interfaces: Length = 4\r\n    IsAnonymousType: False\r\n    IsDefinition: False\r\n    IsGenericType: True\r\n    IsImplicitClass: False\r\n    IsImplicitlyDeclared: False\r\n    IsMustInherit: False\r\n    IsMustOverride: False\r\n    IsNamespace: False\r\n    IsNotInheritable: True\r\n    IsNotOverridable: False\r\n    IsOverridable: False\r\n    IsOverrides: False\r\n    IsReferenceType: True\r\n    IsScriptClass: False\r\n    IsShared: False\r\n    IsSubmissionClass: False\r\n    IsType: True\r\n    IsUnboundGenericType: False\r\n    IsValueType: False\r\n    Kind: NamedType {11}\r\n    Language: \"Visual Basic\"\r\n    Locations: Length = 1\r\n    MemberNames: {Roslyn.Utilities.SpecializedCollections.ReadOnly.Collection(Of System.Collections.Generic.ICollection(Of String), String)}\r\n    MetadataName: \"ArrayBuilder`1\"\r\n    MightContainExtensionMethods: False\r\n    Name: \"ArrayBuilder\"\r\n    OriginalDefinition (Microsoft.CodeAnalysis.VisualBasic.Symbol): NamedType Microsoft.CodeAnalysis.ArrayBuilder(Of T)\r\n    OriginalDefinition (Microsoft.CodeAnalysis.VisualBasic.Symbols.TypeSymbol): NamedType Microsoft.CodeAnalysis.ArrayBuilder(Of T)\r\n    OriginalDefinition: NamedType Microsoft.CodeAnalysis.ArrayBuilder(Of T)\r\n    OriginalSymbolDefinition: NamedType Microsoft.CodeAnalysis.ArrayBuilder(Of T)\r\n    OriginalTypeSymbolDefinition: NamedType Microsoft.CodeAnalysis.ArrayBuilder(Of T)\r\n    SharedConstructors: Length = 0\r\n    SpecialType: None {0}\r\n    TypeArguments: Length = 1\r\n    TypeKind: Class {2}\r\n    TypeParameters: Length = 1\r\n```\r\nBut If I output expressionType.ToString in the mmediate Windows I get a strange result\r\n```\r\n?expressionType.tostring\r\n\"Microsoft.CodeAnalysis.ArrayBuilder(Of LocalState As Microsoft.CodeAnalysis.VisualBasic.AbstractFlowPass(Of LocalState).AbstractLocalState)\"\r\n```\r\nI have tried this same code on 10% of Roslyn Source and this is the only place so far I have seen this odd behavior. It looks like it throws an exception that I have not noticed before trying to get DefaultMarshallingCharSet: which in other cases is Ansi {2}.\r\n"}}