Skip to content

Commit 21ca8a7

Browse files
authored
Merge pull request #5 from apiiro/ohad/fix-RemoteInvocationException
Fix remote invocation exception
2 parents 583154a + 61a3502 commit 21ca8a7

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Analysis/Ast/Impl/Types/Collections/PythonCollectionType.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,12 @@ bool isMutable
5757
public override PythonMemberType MemberType => PythonMemberType.Class;
5858
public override IMember GetMember(string name) => name == @"__iter__" ? IteratorType : base.GetMember(name);
5959

60-
public override IMember CreateInstance(IArgumentSet args)
61-
=> new PythonCollection(this, args.Arguments.Select(a => a.Value).OfType<IMember>().ToArray());
60+
public override IMember CreateInstance(IArgumentSet args) {
61+
var contents = args?.Arguments == null
62+
? Array.Empty<IMember>() :
63+
args.Arguments.Select(a => a.Value).OfType<IMember>().ToArray();
64+
return new PythonCollection(this, contents);
65+
}
6266

6367
public override IMember Call(IPythonInstance instance, string memberName, IArgumentSet args)
6468
=> DeclaringModule.Interpreter.GetBuiltinType(TypeId)?.Call(instance, memberName, args);

0 commit comments

Comments
 (0)