trying to do my own zip, got this code (generic type param T is defined on the enclosing class of this method).
public List<(T, T2)> Zip<T, T2>(SQLList<T2> that)
where T2 : LDBSQLemitter {
var res = this.Zip(that).ToList();
return res;
}
error is
Error CS0029 Cannot implicitly convert type 'System.Collections.Generic.List<(T First, T2 Second)>' to 'System.Collections.Generic.List<(T, T2)>'
What's this First/Second stuff in 'System.Collections.Generic.List<(T First, T2 Second)>', why is it missing in 'System.Collections.Generic.List<(T, T2)>' - - what is it about tuple types I don't understand here?
OK, use try instead to make an explicit conversion of each tuple, so
public List<(T, T2)> Zip<T, T2>(SQLList<T2> that)
where T2 : LDBSQLemitter {
var tmp = this.Zip(that).ToList();
var res = new List<(T, T2)>();
foreach (var x in tmp) {
res.Add((x.First, x.Second));
}
return res;
}
Now the error's completely baffling, apparently complaining it can't convert between 2 identical tuple types:
Error CS1503 Argument 1: cannot convert from '(T, T2)' to '(T, T2)'
Wassup?