public static void Create(INamedTypeSymbol symbol, SymbolKeyWriter visitor) { visitor.WriteString(symbol.Name); visitor.WriteSymbolKey(symbol.ContainingSymbol as INamespaceOrTypeSymbol); visitor.WriteInteger(symbol.Arity); if (!symbol.Equals(symbol.ConstructedFrom)) { visitor.WriteSymbolKeyArray(symbol.TypeArguments); } else { visitor.WriteSymbolKeyArray(default(ImmutableArray<ITypeSymbol>)); } }
public static void Create(INamedTypeSymbol symbol, SymbolKeyWriter visitor) { visitor.WriteString(symbol.MetadataName); visitor.WriteSymbolKey(symbol.ContainingSymbol); visitor.WriteInteger(symbol.Arity); visitor.WriteInteger((int)symbol.TypeKind); visitor.WriteBoolean(symbol.IsUnboundGenericType); if (!symbol.Equals(symbol.ConstructedFrom) && !symbol.IsUnboundGenericType) { visitor.WriteSymbolKeyArray(symbol.TypeArguments); } else { visitor.WriteSymbolKeyArray(default(ImmutableArray<ITypeSymbol>)); } }
public static void Create(INamedTypeSymbol symbol, SymbolKeyWriter visitor) { Debug.Assert(symbol.IsAnonymousType); var properties = symbol.GetMembers().OfType<IPropertySymbol>().ToArray(); var propertyTypes = properties.Select(p => p.Type).ToImmutableArray(); var propertyNames = properties.Select(p => p.Name).ToImmutableArray(); visitor.WriteSymbolKeyArray(propertyTypes); visitor.WriteStringArray(propertyNames); }
public static void Create(INamedTypeSymbol symbol, SymbolKeyWriter visitor) { Debug.Assert(symbol.IsAnonymousType); var properties = symbol.GetMembers().OfType<IPropertySymbol>().ToImmutableArray(); var propertyTypes = properties.SelectAsArray(p => p.Type); var propertyNames = properties.SelectAsArray(p => p.Name); var propertyIsReadOnly = properties.SelectAsArray(p => p.SetMethod == null); var propertyLocations = properties.SelectAsArray(p => p.Locations.FirstOrDefault()); visitor.WriteSymbolKeyArray(propertyTypes); visitor.WriteStringArray(propertyNames); visitor.WriteBooleanArray(propertyIsReadOnly); visitor.WriteLocationArray(propertyLocations); }
public static void Create(IMethodSymbol symbol, SymbolKeyWriter visitor) { visitor.WriteSymbolKey(symbol.ConstructedFrom); visitor.WriteSymbolKeyArray(symbol.TypeArguments); }