ArgumentError when calling System.String..ctor(Char[], int, int)


IronRuby on .NET 2.0.50727.3053
Copyright (c) Microsoft Corporation. All rights reserved.
c = System::Array[System::Char].new(1)
=> ['\x00']
System::String.new(c, 0, 0)
:0: wrong number of arguments (3 for 2) (ArgumentError)
Closed Jul 24, 2009 at 7:04 PM by jredville
spec added


sborde wrote Jun 29, 2009 at 11:01 PM

Using clr_new does work. However, for System::String, new and clr_new should be the same becuase System::String does not map to a Ruby builtin type, right?
System::String.clr_new(c, 0, 0)
=> ''

TomasMatousek wrote Jul 1, 2009 at 10:15 PM

We do monkey patch System::String with methods and custom ctor (see ClrStringOps). I'll add this missing overload.