You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Either the TupleElementIndex should be zero in the following test (commented line) or possibly we should not have a TupleElementFieldSymbol wrapping a SubstitutedFieldSymbol (the SubstitutedFieldSymbol should store the extra information, such as element name and location to be a tuple element by itself).
[Fact]
public void IndexOfUnderlyingFieldsInTuple9()
{
string source = @"
class C
{
(int, int, int, int, int, int, int, int, int) M() => throw null;
}
";
var comp = CreateCompilation(source);
var m = (MethodSymbol)comp.GetMember("C.M");
var tuple = m.ReturnType;
Assert.Equal("(System.Int32, System.Int32, System.Int32, System.Int32, System.Int32, System.Int32, System.Int32, System.Int32, System.Int32)",
tuple.ToTestDisplayString());
Assert.IsType<ConstructedNamedTypeSymbol>(tuple);
var item1 = tuple.GetMember<TupleElementFieldSymbol>("Item1");
Assert.Equal("System.Int32 (System.Int32, System.Int32, System.Int32, System.Int32, System.Int32, System.Int32, System.Int32, System.Int32, System.Int32).Item1",
item1.ToTestDisplayString());
Assert.Equal(0, item1.TupleElementIndex);
var item1Underlying = item1.TupleUnderlyingField;
Assert.Equal("System.Int32 (System.Int32, System.Int32, System.Int32, System.Int32, System.Int32, System.Int32, System.Int32, System.Int32, System.Int32).Item1",
item1Underlying.ToTestDisplayString());
Assert.IsType<SubstitutedFieldSymbol>(item1Underlying);
Assert.Equal(-1, item1Underlying.TupleElementIndex); // should be zero
...
}
The text was updated successfully, but these errors were encountered:
Either the TupleElementIndex should be zero in the following test (commented line) or possibly we should not have a TupleElementFieldSymbol wrapping a SubstitutedFieldSymbol (the SubstitutedFieldSymbol should store the extra information, such as element name and location to be a tuple element by itself).
The text was updated successfully, but these errors were encountered: