Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ public int this[int index]
[Fact]
public static void WriteObjectWorks_ReferenceTypeMissingPublicParameterlessConstructor()
{
PublicParameterizedConstructorTestClass paramterless = PublicParameterizedConstructorTestClass.Instance;
Assert.Equal("{\"Name\":\"42\"}", JsonSerializer.Serialize(paramterless));
PublicParameterizedConstructorTestClass parameterless = PublicParameterizedConstructorTestClass.Instance;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How did you detect these or did you happen to just run across them ad-hoc?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Funny story - my tests were broken in #45911, and I noticed that the exception message coming from mono had this spelling issue. So I grepped the whole repo for the same spelling error and this came up.

Then my eye caught the "Polymorphic" spelling mistake below, so I figured I had to fix that as well, while I was in here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, good old grepping for a string with a typo :)

Assert.Equal("{\"Name\":\"42\"}", JsonSerializer.Serialize(parameterless));

ClassWithInternalParameterlessCtor internalObj = ClassWithInternalParameterlessCtor.Instance;
Assert.Equal("{\"Name\":\"InstancePropertyInternal\"}", JsonSerializer.Serialize(internalObj));
Expand All @@ -103,7 +103,7 @@ public static void WriteObjectWorks_ReferenceTypeMissingPublicParameterlessConst
}

[Fact]
public static void WritePolymorhicSimple()
public static void WritePolymorphicSimple()
{
string json = JsonSerializer.Serialize(new { Prop = (object)new[] { 0 } });
Assert.Equal(@"{""Prop"":[0]}", json);
Expand Down
4 changes: 2 additions & 2 deletions src/mono/mono/metadata/marshal-ilgen.c
Original file line number Diff line number Diff line change
Expand Up @@ -5424,7 +5424,7 @@ emit_marshal_safehandle_ilgen (EmitMarshalContext *m, int argnum, MonoType *t,
*/
ctor = mono_class_get_method_from_name_checked (t->data.klass, ".ctor", 0, 0, local_error);
if (ctor == NULL || !is_ok (local_error)){
mono_mb_emit_exception (mb, "MissingMethodException", "paramterless constructor required");
mono_mb_emit_exception (mb, "MissingMethodException", "parameterless constructor required");
mono_error_cleanup (local_error);
break;
}
Expand Down Expand Up @@ -5470,7 +5470,7 @@ emit_marshal_safehandle_ilgen (EmitMarshalContext *m, int argnum, MonoType *t,
if (ctor == NULL || !is_ok (error)){
mono_error_cleanup (error);
mono_mb_emit_byte (mb, CEE_POP);
mono_mb_emit_exception (mb, "MissingMethodException", "paramterless constructor required");
mono_mb_emit_exception (mb, "MissingMethodException", "parameterless constructor required");
break;
}
/* Store the IntPtr results into a local */
Expand Down
2 changes: 1 addition & 1 deletion src/mono/mono/tests/safehandle.2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ public static int test_0_safehandle_return_noctor ()

return 0;
}
Console.WriteLine ("Failed, expected an exception because there is no paramterless ctor");
Console.WriteLine ("Failed, expected an exception because there is no parameterless ctor");
return 1;
}

Expand Down