Hi, I'm trying to create a simple enumerator in boo.
Unity returns the following.
Ambiguous reference 'GetEnumerator': Lister.GetEnumerator(), Lister.GetEnumerator()
This is working code, according to the standalone boo interpreter, but Unity is messing up somewhere. How can I work around it?
import UnityEngine
import System.Collections
class Lister (Generic.IEnumerable[of int]):
public def GetEnumerator() as Generic.IEnumerator[of int]:
yield 1
yield 2
yield 3
def IEnumerable.GetEnumerator() as IEnumerator:
return GetEnumerator()
[ExecuteInEditMode]
class Enumerable (MonoBehaviour):
def Awake ():
l = Lister()
for i in l:
Debug.Log("$i")
↧