RhinoCode GH, no list available

When input a list in the new RhinoCode component for GH and set the acess to List, I do not actually get a list in the code. Instea it is defined as: System.Collections.Generic.IEnumerable.

if you run the following simple script:

object item = x[0];
    a = item;

you get the error

Compile Error
Cannot apply indexing with [] to an expression of type 'IEnumerable<object>' (Error CS0021) rhinocode:///grasshopper/1/ca315472-c3e8-419e-8f8c-bbeb764b7c25/2140d450-8add-4bb8-9817-10f6df7120bb:[56:19]

it seems that IEnumerables cannot be indexed like lists. Is this a bug or a feature? :smiley:

p.s.: and yes the error points to the wrong line (56), which does not even exist…

1 Like

Also for List.Count; inList<RhinoGrometry>in new gh script code components grasshopper rhino8wip
Have Error but for List.Count() not error!!!
Is this error or features?

btw an iterim solution (brought to you by a collegue, who is good with C#) would be to convert the IEnumerable to a list with

using System.Linq;

List<object> y = x.ToList();