Closed CreateAndInject closed 2 years ago
Rename ITupleInternal to ITuple, mark it as public and support this[] & Length like in .NET Framework
ITupleInternal
ITuple
public
this[]
Length
For example, I can't do something like this in Theraot.Core
static void Main() { Test(1, "han", ("aa", 1), (1, 0, "test", 1)); } static void Test(params object[] args) { foreach (object obj in args) { if (obj is ITuple tuple) { for (int i = 0; i < tuple.Length; i++) Console.WriteLine(tuple[i]); if (tuple.Length == 2) { Console.WriteLine(tuple[0] is string); Console.WriteLine(tuple[1] is int); } } } }
By the way, both Tuple and ValueTuple should implement ITuple
Merged in my own project
Rename
ITupleInternal
toITuple
, mark it aspublic
and supportthis[]
&Length
like in .NET FrameworkFor example, I can't do something like this in Theraot.Core