Skip to content

Commit f542095

Browse files
committed
Fix implicit non-trivial default ctor
1 parent 43626c3 commit f542095

File tree

3 files changed

+2
-3
lines changed

3 files changed

+2
-3
lines changed

src/Generator/AST/Utils.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public static bool CheckIgnoreMethod(Method method)
3030
var isEmptyCtor = method.IsConstructor && method.Parameters.Count == 0;
3131

3232
var @class = method.Namespace as Class;
33-
if (@class != null && @class.IsValueType && isEmptyCtor && method.IsDefaulted)
33+
if (@class != null && @class.IsValueType && isEmptyCtor && !@class.HasNonTrivialDefaultConstructor)
3434
return true;
3535

3636
if (method.IsDestructor)

tests/dotnet/CSharp/CSharp.Tests.cs

-1
Original file line numberDiff line numberDiff line change
@@ -2050,7 +2050,6 @@ public void TestValueTypeStringMemberDefaulted()
20502050
}
20512051

20522052
[Test]
2053-
[Ignore("https://github.com/mono/CppSharp/issues/1777")]
20542053
public void TestValueTypeStringMemberDefaultedCtor()
20552054
{
20562055
var test = new CSharp.ValueTypeNoCtor();
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<LangVersion>10.0</LangVersion>
3+
<LangVersion>11.0</LangVersion>
44
</PropertyGroup>
55
</Project>

0 commit comments

Comments
 (0)