Quantcast
Channel: ClearScript
Viewing all articles
Browse latest Browse all 2297

Edited Issue: Unable to use IEnumerator objects from script [14]

$
0
0
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.

Viewing all articles
Browse latest Browse all 2297

Latest Images

Trending Articles





Latest Images