Handle interop better

This commit is contained in:
Deukhoofd 2019-01-23 15:04:10 +01:00
parent 364e71198e
commit ac12fbb60d
No known key found for this signature in database
GPG Key ID: B4C087AC81641654
2 changed files with 12 additions and 8 deletions

View File

@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Collections.Immutable;
using System.Linq;
using Upsilon.BaseTypes.ScriptTypeInterfaces;
using Upsilon.BaseTypes.UserData;
using Upsilon.Binder;
using Upsilon.Binder.VariableSymbols;
using Upsilon.Evaluator;
@ -52,7 +53,13 @@ namespace Upsilon.BaseTypes.ScriptFunction
{
continue;
}
var parameterType = v.GetType();
System.Type parameterType;
if (v is GenericUserData ud)
parameterType = ud.GetCSharpType();
else
parameterType = v.GetType();
if (parameterSymbol.BoundTypeDefinition != null)
{
var validSymbol =

View File

@ -27,15 +27,12 @@ namespace Upsilon.StandardLibraries
{
if (_staticScope != null)
return _staticScope;
lock (Scope)
{
var (evaluationScope, boundScope) = CreateStandardLibrary();
_staticScope = evaluationScope;
_staticBoundScope = boundScope;
return _staticScope;
}
}
}
public static BoundScope BoundScope
{