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

View File

@ -27,13 +27,10 @@ namespace Upsilon.StandardLibraries
{ {
if (_staticScope != null) if (_staticScope != null)
return _staticScope; return _staticScope;
lock (Scope) var (evaluationScope, boundScope) = CreateStandardLibrary();
{ _staticScope = evaluationScope;
var (evaluationScope, boundScope) = CreateStandardLibrary(); _staticBoundScope = boundScope;
_staticScope = evaluationScope; return _staticScope;
_staticBoundScope = boundScope;
return _staticScope;
}
} }
} }