public static INamedTypeSymbol CreateTupleTypeSymbol( this CSharpCompilation comp, NamedTypeSymbol underlyingType, ImmutableArray <string> elementNames = default, ImmutableArray <Location> elementLocations = default) { return(comp.CreateTupleTypeSymbol(underlyingType.GetPublicSymbol(), elementNames, elementLocations)); }
public void GetFriendlyName_ShouldWorkWithTuples() { CSharpCompilation compilation = CreateCompilation(string.Empty); INamedTypeSymbol tuple = compilation.CreateTupleTypeSymbol(new ITypeSymbol[] { compilation.GetSpecialType(SpecialType.System_String), compilation.GetSpecialType(SpecialType.System_Int32) }.ToImmutableArray(), new[] { "Cica", "Mica" }.ToImmutableArray()); Assert.That(tuple.GetFriendlyName(), Is.EqualTo("System.ValueTuple")); }
public static INamedTypeSymbol CreateTupleTypeSymbol( this CSharpCompilation comp, ImmutableArray <TypeSymbol> elementTypes, ImmutableArray <string> elementNames = default, ImmutableArray <Location> elementLocations = default, ImmutableArray <Microsoft.CodeAnalysis.NullableAnnotation> elementNullableAnnotations = default) { return(comp.CreateTupleTypeSymbol(elementTypes.GetPublicSymbols(), elementNames, elementLocations, elementNullableAnnotations)); }