When I try to call Length method it does not exist on ‘Tuple’ instanse
Tuple<int, string> tuple = Tuple.Create(1, "1");
var l = tuple.Length;
And i receive default error like this “Error CS1061 ‘Tuple<int, string, int, int, char>’ does not contain a definition for ‘Length’ and no accessible extension method ‘Length’ accepting a first argument of type ‘Tuple<int, string, int, int, char>’ could be found (are you missing a using directive or an assembly reference?)”
But Tuple implement interface ITuple from System.Runtime.CompilerServices that contains Lenth method
In addition if I do explicit cast to ITuple method exist
Tuple<int, string> tuple = Tuple.Create(1, "1");
var l = ((ITuple)tuple).Length;
eeevance06 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.