- Home /
Question by
Essential · Jan 12, 2014 at 02:28 AM ·
errorlistrepeatmissingmethodexceptionienumerable
Can I use IENumerable.Repeat in Unity?
import System.Collections.Generic;
var myList = List.<myClass>();
class myClass {}
var myItem = new myClass();
myList.AddRange( IEnumerable.Repeat(myItem,2) );
gives this error: MissingMethodException: System.Collections.IEnumerable.Repeat Boo.Lang.Runtime.DynamicDispatching.MethodDispatcherFactory.ProduceExtensionDispatcher () ...
Comment
If you look at the documentation for IEnumerable.Repeat
on msdn and scroll down to the example you will see your answer.