When trying to enumerator elements by using collection.GetEnumerator(), the script engine cannot find the enumerator's MoveNext() method even though it is public accessible.
E.g. for List<Foo>, it will produce the following error:
'System.Collections.Generic.IEnumerator<Foo>' does not contain a definition for 'MoveNext'
for the following script:
var enumerator = list.GetEnumerator();
while (enumerator.MoveNext()) { ... }
I tried to debug into the source code. It indeed find the public MoveNext() method, but later in binder.Bind() it generates a throw expression.
E.g. for List<Foo>, it will produce the following error:
'System.Collections.Generic.IEnumerator<Foo>' does not contain a definition for 'MoveNext'
for the following script:
var enumerator = list.GetEnumerator();
while (enumerator.MoveNext()) { ... }
I tried to debug into the source code. It indeed find the public MoveNext() method, but later in binder.Bind() it generates a throw expression.