Question no accessible 'Select' accept this number of types arguments..(Enumerable and Tuple)

CuteSkull

New member
Joined
Oct 3, 2013
Messages
2
Programming Experience
3-5
error :
Overload resolution failed because no accessible 'Select' accept this number of types arguments

Line
VB.NET:
Dim tuples As List(Of Tuple(Of Integer, Integer)) = New List(Of Tuple(Of Integer, Integer))
tuples.AddRange(Enumerable.Range(0, 13).Select(Of Integer, Tuple(Of Integer, Integer))(Function(x As Integer) New Tuple(Of Integer, Integer)(24 - x, 10 + x)))

I guess it has something to do with providing a Source for the 'Select'... however I want to use the Enumerable.Range(0, 13) as source so that x would represent the index.
any help or even a small hint is appreciated.
thanks for your time.

Edit:
VB.NET:
tuples.AddRange(Enumerable.Range(0, 13).Select(Function(x As Integer) New Tuple(Of Integer, Integer)(24 - x, 10 + x)))

VB accepts this syntax..... but will it result in some kind of run time error? a type conversion error or something?
and will it use the index as a source for the x?
thank you again for all the help that you will provide.
 
Last edited:
Why don't you try explaining in your own words what you want to accomplish with that list? Almost positive Enumerable.Range is not what you want here. Almost positive the .Select is not what you want either.

Is this what you want to do?

For x = 0 To 13
    tuples.Add(New Tuple(Of Integer, Integer)(24 - x, 10 + x))
Next
 
Thanx Herman for your time, I really appreciate your help.

Actually that is not my code.. i was just trying to fix the errors in it.
but yeah I think I can understand it after looking at your answer and looking at Microsoft description, select method basically is an assign operator.

Thanx again Herman ^^


Why don't you try explaining in your own words what you want to accomplish with that list? Almost positive Enumerable.Range is not what you want here. Almost positive the .Select is not what you want either.

Is this what you want to do?

For x = 0 To 13
    tuples.Add(New Tuple(Of Integer, Integer)(24 - x, 10 + x))
Next
 
Back
Top