v = this_obj.InvokeMethod (e.Thread, m, new Value [] { s });
AssertValue (2, v);
- return;
-
- // string constructor
- var stringType = vm.RootDomain.Corlib.GetType ("System.String");
- var stringConstructor = stringType.GetMethods ().Single (c=>
- c.Name == ".ctor" &&
- c.GetParameters ().Length == 2 &&
- c.GetParameters ()[0].ParameterType.Name == "Char" &&
- c.GetParameters ()[1].ParameterType.Name == "Int32");
- var str = stringType.NewInstance (e.Thread, stringConstructor, new Value [] { vm.CreateValue ('a'), vm.CreateValue (3)});
-
- AssertValue("aaa", str);
-
// pass primitive
m = t.GetMethod ("invoke_pass_primitive");
Value[] args = new Value [] {
task = t.InvokeMethodAsync (e.Thread, m, new Value [] { vm.RootDomain.CreateString ("ABC") });
AssertValue ("ABC", task.Result);
+ // string constructor
+ var stringType = vm.RootDomain.Corlib.GetType ("System.String");
+ var stringConstructor = stringType.GetMethods ().Single (c=>
+ c.Name == ".ctor" &&
+ c.GetParameters ().Length == 2 &&
+ c.GetParameters ()[0].ParameterType.Name == "Char" &&
+ c.GetParameters ()[1].ParameterType.Name == "Int32");
+ var str = stringType.NewInstance (e.Thread, stringConstructor, new Value [] { vm.CreateValue ('a'), vm.CreateValue (3)});
+
+ AssertValue("aaa", str);
+
// Argument checking
// null thread
if ((invoke->flags & INVOKE_FLAG_RETURN_OUT_ARGS) && CHECK_PROTOCOL_VERSION (2, 35))
out_args = TRUE;
buffer_add_byte (buf, 1 + (out_this ? 2 : 0) + (out_args ? 4 : 0));
- if (sig->ret->type == MONO_TYPE_VOID) {
+ if (m->string_ctor) {
+ buffer_add_value (buf, &mono_get_string_class ()->byval_arg, &res, domain);
+ } else if (sig->ret->type == MONO_TYPE_VOID && !m->string_ctor) {
if (!strcmp (m->name, ".ctor")) {
if (!m->klass->valuetype)
buffer_add_value (buf, &mono_defaults.object_class->byval_arg, &this_arg, domain);