File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
src/Analysis/Ast/Impl/Types/Collections Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff 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 ) ;
You can’t perform that action at this time.
0 commit comments