Make coroutine functions be forced to be created with the coroutine keyword.

This commit is contained in:
2019-02-14 12:42:47 +01:00
parent dbf4d8a82e
commit 8da35b4e71
9 changed files with 38 additions and 18 deletions

View File

@@ -1,3 +1,4 @@
using System.Collections;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
@@ -77,7 +78,8 @@ namespace Upsilon.BaseTypes.UserData
}
if (Methods.TryGetValue(member, out var method))
{
return (new ScriptMethodInfoFunction(method, value, false), false, null);
var isCoroutine = typeof(IEnumerator).IsAssignableFrom(method.ReturnType);
return (new ScriptMethodInfoFunction(method, value, false, isCoroutine), false, null);
}
return (null, true, $"Can't find public member '{member}' on type '{Type}'.");