From f72e44b9eedd8ad9539bb2b1293a10ffa5e604eb Mon Sep 17 00:00:00 2001
From: IX-BOT <137874481+IX-BOT@users.noreply.github.com>
Date: Fri, 10 May 2024 20:14:02 +0200
Subject: [PATCH] [BUG] Poco array fields are null (#312)
* Create draft PR for #311
* The most significant changes involve the addition of the `CsPlainConstructorBuilder.cs` file and modifications to the `CsPlainSourceBuilder.cs` file. The new file contains the `CsPlainConstructorBuilder` class, which is used to build constructors for classes. The `CsPlainSourceBuilder.cs` file was updated to use this new class, specifically the `Create` method, to add constructors to the source code. Additionally, the `Arrays.cs` file was updated with a new method for creating and initializing arrays, and the `PlainersSwappingTests.cs` file had code for initializing an array commented out.
Changes:
1. Addition of `CsPlainConstructorBuilder.cs` file: This new file contains the `CsPlainConstructorBuilder` class, which is used to build constructors for classes. It implements the `ICombinedThreeVisitor` interface and contains methods for creating different types of declarations and adding them to the source code. It also contains a `Create` method which is used to create a new instance of the `CsPlainConstructorBuilder` class and add the constructor to the source code.
2. Modification of `CsPlainSourceBuilder.cs` file: The `using AXSharp.Compiler.Cs.Onliner;` directive was added to allow the `CsPlainSourceBuilder` class to use the `CsPlainConstructorBuilder` class. The `CsPlainConstructorBuilder.Create` method was added to the `CreateClassDeclaration` method, creating a new instance of the `CsPlainConstructorBuilder` class and adding the constructor to the source code.
3. Addition of `InstantiateArray` method in `Arrays.cs` file: This new method is used to create a new array and initialize it with a specified initializer function and array bounds.
4. Commenting out of array initialization in `PlainersSwappingTests.cs` file: The code for initializing the `ArrayOfDrives` array was commented out, suggesting that the array is now being initialized elsewhere, possibly in the constructor of the `p` object.
---------
Co-authored-by: PTKu <61538034+PTKu@users.noreply.github.com>
---
.../Plain/CsPlainConstructorBuilder.cs | 167 +++++++++
.../Plain/CsPlainSourceBuilder.cs | 2 +
.../expected/.g/POCO/abstract_members.g.cs | 4 +
.../expected/.g/POCO/array_declaration.g.cs | 10 +
.../.g/POCO/class_all_primitives.g.cs | 4 +
.../.g/POCO/class_extended_by_known_type.g.cs | 7 +
.../units/expected/.g/POCO/class_extends.g.cs | 6 +
.../.g/POCO/class_extends_and_implements.g.cs | 6 +
.../.g/POCO/class_generic_extension.g.cs | 14 +
.../expected/.g/POCO/class_implements.g.cs | 3 +
.../.g/POCO/class_implements_multiple.g.cs | 3 +
.../expected/.g/POCO/class_internal.g.cs | 3 +
.../.g/POCO/class_no_access_modifier.g.cs | 3 +
.../.g/POCO/class_with_complex_members.g.cs | 7 +
.../POCO/class_with_non_public_members.g.cs | 7 +
.../expected/.g/POCO/class_with_pragmas.g.cs | 7 +
.../.g/POCO/class_with_primitive_members.g.cs | 4 +
.../.g/POCO/class_with_using_directives.g.cs | 4 +
.../.g/POCO/compileromitsattribute.g.cs | 31 ++
.../units/expected/.g/POCO/configuration.g.cs | 4 +
.../expected/.g/POCO/file_with_usings.g.cs | 12 +
.../units/expected/.g/POCO/generics.g.cs | 11 +
.../units/expected/.g/POCO/makereadonce.g.cs | 8 +
.../units/expected/.g/POCO/makereadonly.g.cs | 8 +
.../samples/units/expected/.g/POCO/misc.g.cs | 23 ++
.../units/expected/.g/POCO/mixed_access.g.cs | 14 +
.../units/expected/.g/POCO/ref_to_simple.g.cs | 7 +
.../expected/.g/POCO/simple_empty_class.g.cs | 3 +
.../simple_empty_class_within_namespace.g.cs | 3 +
.../expected/.g/POCO/type_named_values.g.cs | 4 +
.../.g/POCO/type_named_values_literals.g.cs | 4 +
.../expected/.g/POCO/type_with_enum.g.cs | 4 +
.../.g/POCO/types_with_name_attributes.g.cs | 4 +
.../POCO/types_with_property_attributes.g.cs | 4 +
.../BuilderHelpers/Arrays.cs | 23 ++
.../integrated/src/ax/apax-lock.json | 332 +++++++++---------
.../integrated/src/ax/apax.yml | 2 +-
.../.g/POCO/configuration.g.cs | 6 +
.../.g/POCO/dataswapping/all_primitives.g.cs | 4 +
.../.g/POCO/dataswapping/moster.g.cs | 15 +
.../.g/POCO/dataswapping/realmonster.g.cs | 27 ++
.../integrated/src/integrated.twin/Entry.cs | 4 +-
.../integrated.tests/PlainersSwappingTests.cs | 8 +-
43 files changed, 653 insertions(+), 173 deletions(-)
create mode 100644 src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Plain/CsPlainConstructorBuilder.cs
diff --git a/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Plain/CsPlainConstructorBuilder.cs b/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Plain/CsPlainConstructorBuilder.cs
new file mode 100644
index 00000000..81d0d31b
--- /dev/null
+++ b/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Plain/CsPlainConstructorBuilder.cs
@@ -0,0 +1,167 @@
+// AXSharp.Compiler.Cs
+// Copyright (c) 2023 Peter Kurhajec (PTKu), MTS, and Contributors. All Rights Reserved.
+// Contributors: https://github.com/ix-ax/axsharp/graphs/contributors
+// See the LICENSE file in the repository root for more information.
+// https://github.com/ix-ax/axsharp/blob/dev/LICENSE
+// Third party licenses: https://github.com/ix-ax/axsharp/blob/master/notices.md
+
+using System.Globalization;
+using System.Text;
+using AX.ST.Semantic;
+using AX.ST.Semantic.Model;
+using AX.ST.Semantic.Model.Declarations;
+using AX.ST.Semantic.Model.Declarations.Types;
+using AX.ST.Syntax.Parser;
+using AXSharp.Compiler.Core;
+using AXSharp.Compiler.Cs.Helpers;
+using AXSharp.Compiler.Cs.Helpers.Onliners;
+using AXSharp.Connector;
+using AXSharp.Connector.BuilderHelpers;
+using AXSharp.Compiler.Cs;
+
+namespace AXSharp.Compiler.Cs.Onliner;
+
+internal class CsPlainConstructorBuilder : ICombinedThreeVisitor
+{
+ private readonly StringBuilder _constructorStatements = new();
+
+ protected CsPlainConstructorBuilder(ISourceBuilder sourceBuilder)
+ {
+ SourceBuilder = sourceBuilder;
+ }
+
+ protected ISourceBuilder SourceBuilder { get; }
+
+ public string Output => _constructorStatements.ToString().FormatCode();
+
+ public void CreateClassDeclaration(IClassDeclaration classDeclaration, IxNodeVisitor visitor)
+ {
+ AddToSource($"{classDeclaration.GetQualifiedName()}");
+ }
+
+ public void CreateReferenceToDeclaration(IReferenceTypeDeclaration referenceTypeDeclaration, IxNodeVisitor visitor)
+ {
+ referenceTypeDeclaration.ReferencedType.Accept(visitor, this);
+ }
+
+ public void CreateScalarTypeDeclaration(IScalarTypeDeclaration scalarTypeDeclaration, IxNodeVisitor visitor)
+ {
+ AddToSource($"{scalarTypeDeclaration.TransformType()}");
+ }
+
+ public void CreateSemanticTypeAccess(ISemanticTypeAccess semanticTypeAccess, IxNodeVisitor visitor)
+ {
+ semanticTypeAccess.Type.Accept(visitor, this);
+ }
+
+ public void CreateStringTypeDeclaration(IStringTypeDeclaration stringTypeDeclaration, IxNodeVisitor visitor)
+ {
+ AddToSource($"{stringTypeDeclaration.TransformType()}");
+ }
+
+ public void CreateStructuredType(IStructuredTypeDeclaration structuredTypeDeclaration, IxNodeVisitor visitor)
+ {
+ AddToSource($"{structuredTypeDeclaration.GetQualifiedName()}");
+ }
+
+ public void CreateFieldDeclaration(IFieldDeclaration fieldDeclaration, IxNodeVisitor visitor)
+ {
+ if (fieldDeclaration.IsMemberEligibleForConstructor(SourceBuilder))
+ {
+ switch (fieldDeclaration.Type)
+ {
+ case IArrayTypeDeclaration array:
+ AddArrayMemberInitialization(array, fieldDeclaration, visitor);
+ break;
+ }
+ }
+ }
+
+ public virtual void CreateNamedValueTypeDeclaration(INamedValueTypeDeclaration namedValueTypeDeclaration,
+ IxNodeVisitor visitor)
+ {
+ AddToSource(namedValueTypeDeclaration.ValueTypeAccess.Type.Name.ToUpperInvariant());
+ }
+
+ public void CreateInterfaceDeclaration(IInterfaceDeclaration interfaceDeclaration, IxNodeVisitor visitor)
+ {
+ // No way to construct interfaces.
+ }
+
+ public void CreateArrayTypeDeclaration(IArrayTypeDeclaration arrayTypeDeclaration, IxNodeVisitor visitor)
+ {
+
+ }
+
+ protected void AddToSource(string token, string separator = " ")
+ {
+ _constructorStatements.Append($"{token}{separator}");
+ }
+
+ public static CsPlainConstructorBuilder Create(IxNodeVisitor visitor, IClassDeclaration semantics,
+ ISourceBuilder sourceBuilder, bool isExtended, AXSharpProject project)
+ {
+ var builder = new CsPlainConstructorBuilder(sourceBuilder);
+
+
+ builder.AddToSource(
+ $"public {semantics.Name}()");
+
+
+ if (isExtended)
+ {
+ builder.AddToSource(": base()");
+ }
+
+ builder.AddToSource("{");
+
+ semantics.Fields.ToList().ForEach(p => p.Accept(visitor, builder));
+
+ builder.AddToSource("}");
+ return builder;
+ }
+
+ private void AddArrayMemberInitialization(IArrayTypeDeclaration type, IFieldDeclaration field,
+ IxNodeVisitor visitor)
+ {
+ if(!type.IsMemberEligibleForConstructor(this.SourceBuilder))
+ return;
+
+ switch (type.ElementTypeAccess.Type)
+ {
+ case IClassDeclaration classDeclaration:
+ case IStructuredTypeDeclaration structuredTypeDeclaration:
+ case IEnumTypeDeclaration enumTypeDeclaration:
+ case INamedValueTypeDeclaration namedValueTypeDeclaration:
+ AddToSource("#pragma warning disable CS0612\n");
+ AddToSource($"{typeof(Arrays).n()}.InstantiateArray({field.Name}, " +
+ "() => ");
+ AddToSource("new");
+ type.ElementTypeAccess.Type.Accept(visitor, this);
+ var dimensions = "new[] {";
+ foreach (var dimension in type.Dimensions)
+ {
+ dimensions = $"{dimensions}({dimension.LowerBoundValue}, {dimension.UpperBoundValue})";
+ }
+
+ dimensions = $"{dimensions}}}";
+
+ AddToSource($"(), {dimensions});");
+ AddToSource("#pragma warning restore CS0612\n");
+ break;
+ }
+ }
+
+
+
+ public void AddTypeConstructionParameters(string parametersString)
+ {
+ AddToSource(parametersString);
+ }
+
+ ///
+ public void CreateDocComment(IDocComment semanticTypeAccess, ICombinedThreeVisitor data)
+ {
+ AddToSource(semanticTypeAccess.AddDocumentationComment(SourceBuilder));
+ }
+}
\ No newline at end of file
diff --git a/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Plain/CsPlainSourceBuilder.cs b/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Plain/CsPlainSourceBuilder.cs
index 3e17b1f5..e8479b88 100644
--- a/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Plain/CsPlainSourceBuilder.cs
+++ b/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Plain/CsPlainSourceBuilder.cs
@@ -15,6 +15,7 @@
using AXSharp.Compiler.Core;
using AXSharp.Compiler.Cs.Helpers;
using AXSharp.Compiler.Cs.Helpers.Plain;
+using AXSharp.Compiler.Cs.Onliner;
namespace AXSharp.Compiler.Cs.Plain;
@@ -88,6 +89,7 @@ public class CsPlainSourceBuilder : ICombinedThreeVisitor, ISourceBuilder
AddToSource("{");
+ AddToSource(CsPlainConstructorBuilder.Create(visitor, classDeclaration, this, isExtended, Project).Output);
classDeclarationSyntax.UsingDirectives.ToList().ForEach(p => p.Visit(visitor, this));
classDeclaration.Fields.ToList().ForEach(p => p.Accept(visitor, this));
AddToSource("}");
diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/abstract_members.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/abstract_members.g.cs
index d11d4a1f..65792f74 100644
--- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/abstract_members.g.cs
+++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/abstract_members.g.cs
@@ -4,6 +4,10 @@ namespace Pocos
{
public partial class AbstractMotor : AXSharp.Connector.IPlain
{
+ public AbstractMotor()
+ {
+ }
+
public Boolean Run { get; set; }
public Boolean ReverseDirection { get; set; }
diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/array_declaration.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/array_declaration.g.cs
index 1f6cf1a1..dea187df 100644
--- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/array_declaration.g.cs
+++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/array_declaration.g.cs
@@ -6,12 +6,22 @@ namespace ArrayDeclarationSimpleNamespace
{
public partial class array_declaration_class : AXSharp.Connector.IPlain
{
+ public array_declaration_class()
+ {
+#pragma warning disable CS0612
+ AXSharp.Connector.BuilderHelpers.Arrays.InstantiateArray(complex, () => new ArrayDeclarationSimpleNamespace.some_complex_type(), new[] { (1, 100) });
+#pragma warning restore CS0612
+ }
+
public Int16[] primitive { get; set; } = new Int16[100];
public ArrayDeclarationSimpleNamespace.some_complex_type[] complex { get; set; } = new ArrayDeclarationSimpleNamespace.some_complex_type[100];
}
public partial class some_complex_type : AXSharp.Connector.IPlain
{
+ public some_complex_type()
+ {
+ }
}
}
}
\ No newline at end of file
diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_all_primitives.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_all_primitives.g.cs
index 6066e48b..72679fc5 100644
--- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_all_primitives.g.cs
+++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_all_primitives.g.cs
@@ -4,6 +4,10 @@ namespace Pocos
{
public partial class class_all_primitives : AXSharp.Connector.IPlain
{
+ public class_all_primitives()
+ {
+ }
+
public Boolean myBOOL { get; set; }
public Byte myBYTE { get; set; }
diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_extended_by_known_type.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_extended_by_known_type.g.cs
index d0264b84..981ce150 100644
--- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_extended_by_known_type.g.cs
+++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_extended_by_known_type.g.cs
@@ -6,6 +6,9 @@ namespace Simatic.Ax.StateFramework
{
public partial class State1Transition : Simatic.Ax.StateFramework.AbstractState, AXSharp.Connector.IPlain
{
+ public State1Transition() : base()
+ {
+ }
}
}
@@ -13,6 +16,10 @@ namespace Simatic.Ax.StateFramework
{
public partial class AbstractState : AXSharp.Connector.IPlain, IState, IStateMuteable
{
+ public AbstractState()
+ {
+ }
+
public Int16 StateID { get; set; }
public string StateName { get; set; } = string.Empty;
diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_extends.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_extends.g.cs
index d0c0aecc..e79f54a2 100644
--- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_extends.g.cs
+++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_extends.g.cs
@@ -4,9 +4,15 @@ namespace Pocos
{
public partial class Extended : Extendee, AXSharp.Connector.IPlain
{
+ public Extended() : base()
+ {
+ }
}
public partial class Extendee : AXSharp.Connector.IPlain
{
+ public Extendee()
+ {
+ }
}
}
\ No newline at end of file
diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_extends_and_implements.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_extends_and_implements.g.cs
index 094f13c3..8de92fc8 100644
--- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_extends_and_implements.g.cs
+++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_extends_and_implements.g.cs
@@ -4,10 +4,16 @@ namespace Pocos
{
public partial class ExtendsAndImplements : ExtendeeExtendsAndImplements, AXSharp.Connector.IPlain, IImplementation1, IImplementation2
{
+ public ExtendsAndImplements() : base()
+ {
+ }
}
public partial class ExtendeeExtendsAndImplements : AXSharp.Connector.IPlain
{
+ public ExtendeeExtendsAndImplements()
+ {
+ }
}
public partial interface IImplementation1
diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_generic_extension.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_generic_extension.g.cs
index 19a5b8c8..8440e0be 100644
--- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_generic_extension.g.cs
+++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_generic_extension.g.cs
@@ -6,21 +6,35 @@ namespace Generics
{
public partial class Extender : AXSharp.Connector.IPlain
{
+ public Extender()
+ {
+ }
}
public partial class Extendee : Generics.Extender, AXSharp.Connector.IPlain
{
+ public Extendee() : base()
+ {
+ }
+
public Generics.SomeType SomeType { get; set; } = new Generics.SomeType();
public Generics.SomeType SomeTypeAsPoco { get; set; } = new Generics.SomeType();
}
public partial class Extendee2 : Generics.Extender, AXSharp.Connector.IPlain
{
+ public Extendee2() : base()
+ {
+ }
+
public Generics.SomeType SomeType { get; set; } = new Generics.SomeType();
}
public partial class SomeType : AXSharp.Connector.IPlain
{
+ public SomeType()
+ {
+ }
}
}
}
\ No newline at end of file
diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_implements.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_implements.g.cs
index 2afa534b..51a00754 100644
--- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_implements.g.cs
+++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_implements.g.cs
@@ -4,6 +4,9 @@ namespace Pocos
{
public partial class _NULL_CONTEXT : AXSharp.Connector.IPlain, IContext
{
+ public _NULL_CONTEXT()
+ {
+ }
}
public partial interface IContext
diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_implements_multiple.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_implements_multiple.g.cs
index 7eac697e..48f81b2a 100644
--- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_implements_multiple.g.cs
+++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_implements_multiple.g.cs
@@ -4,6 +4,9 @@ namespace Pocos
{
public partial class _NULL_CONTEXT_MULTIPLE : AXSharp.Connector.IPlain, IContext_Multiple, IObject_Multiple
{
+ public _NULL_CONTEXT_MULTIPLE()
+ {
+ }
}
public partial interface IContext_Multiple
diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_internal.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_internal.g.cs
index a1ac8818..78060d53 100644
--- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_internal.g.cs
+++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_internal.g.cs
@@ -4,5 +4,8 @@ namespace Pocos
{
internal partial class ClassWithComplexTypes : AXSharp.Connector.IPlain
{
+ public ClassWithComplexTypes()
+ {
+ }
}
}
\ No newline at end of file
diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_no_access_modifier.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_no_access_modifier.g.cs
index 46710acf..35e8a50a 100644
--- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_no_access_modifier.g.cs
+++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_no_access_modifier.g.cs
@@ -4,5 +4,8 @@ namespace Pocos
{
public partial class NoAccessModifierClass : AXSharp.Connector.IPlain
{
+ public NoAccessModifierClass()
+ {
+ }
}
}
\ No newline at end of file
diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_with_complex_members.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_with_complex_members.g.cs
index 9ff7ea51..81b3bb0a 100644
--- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_with_complex_members.g.cs
+++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_with_complex_members.g.cs
@@ -6,11 +6,18 @@ namespace ClassWithComplexTypesNamespace
{
public partial class ClassWithComplexTypes : AXSharp.Connector.IPlain
{
+ public ClassWithComplexTypes()
+ {
+ }
+
public ClassWithComplexTypesNamespace.ComplexType1 myComplexType { get; set; } = new ClassWithComplexTypesNamespace.ComplexType1();
}
public partial class ComplexType1 : AXSharp.Connector.IPlain
{
+ public ComplexType1()
+ {
+ }
}
}
}
\ No newline at end of file
diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_with_non_public_members.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_with_non_public_members.g.cs
index 9fd75d15..7ffd1c51 100644
--- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_with_non_public_members.g.cs
+++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_with_non_public_members.g.cs
@@ -6,11 +6,18 @@ namespace ClassWithNonTraspilableMemberssNamespace
{
public partial class ClassWithNonTraspilableMembers : AXSharp.Connector.IPlain
{
+ public ClassWithNonTraspilableMembers()
+ {
+ }
+
public ClassWithNonTraspilableMemberssNamespace.ComplexType1 myComplexType { get; set; } = new ClassWithNonTraspilableMemberssNamespace.ComplexType1();
}
public partial class ComplexType1 : AXSharp.Connector.IPlain
{
+ public ComplexType1()
+ {
+ }
}
}
}
\ No newline at end of file
diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_with_pragmas.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_with_pragmas.g.cs
index 5977417b..df4dd537 100644
--- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_with_pragmas.g.cs
+++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_with_pragmas.g.cs
@@ -6,11 +6,18 @@ namespace ClassWithPragmasNamespace
{
public partial class ClassWithPragmas : AXSharp.Connector.IPlain
{
+ public ClassWithPragmas()
+ {
+ }
+
public ClassWithPragmasNamespace.ComplexType1 myComplexType { get; set; } = new ClassWithPragmasNamespace.ComplexType1();
}
public partial class ComplexType1 : AXSharp.Connector.IPlain
{
+ public ComplexType1()
+ {
+ }
}
}
}
\ No newline at end of file
diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_with_primitive_members.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_with_primitive_members.g.cs
index 0c1b97f7..694cfb6b 100644
--- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_with_primitive_members.g.cs
+++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_with_primitive_members.g.cs
@@ -6,6 +6,10 @@ namespace ClassWithPrimitiveTypesNamespace
{
public partial class ClassWithPrimitiveTypes : AXSharp.Connector.IPlain
{
+ public ClassWithPrimitiveTypes()
+ {
+ }
+
public Boolean myBOOL { get; set; }
public Byte myBYTE { get; set; }
diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_with_using_directives.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_with_using_directives.g.cs
index 9eefca65..88b09bb4 100644
--- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_with_using_directives.g.cs
+++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_with_using_directives.g.cs
@@ -8,6 +8,10 @@ namespace Pocos
internal partial class ClassWithUsingDirectives : AXSharp.Connector.IPlain
{
+ public ClassWithUsingDirectives()
+ {
+ }
+
using SimpleFirstLevelNamespace ; using SimpleQualifiedNamespace . Qualified ; using HelloLevelOne . HelloLevelTwo ;
}
diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/compileromitsattribute.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/compileromitsattribute.g.cs
index 4b20362c..b23c44bc 100644
--- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/compileromitsattribute.g.cs
+++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/compileromitsattribute.g.cs
@@ -6,12 +6,20 @@ namespace CompilerOmmits
{
public partial class ClassWithArrays : AXSharp.Connector.IPlain
{
+ public ClassWithArrays()
+ {
+ }
+
public CompilerOmmits.Complex _must_be_omitted_in_onliner { get; set; } = new CompilerOmmits.Complex();
public Byte[] _primitive { get; set; } = new Byte[11];
}
public partial class Complex : AXSharp.Connector.IPlain
{
+ public Complex()
+ {
+ }
+
public string HelloString { get; set; } = string.Empty;
public UInt64 Id { get; set; }
}
@@ -21,6 +29,10 @@ namespace Enums
{
public partial class ClassWithEnums : AXSharp.Connector.IPlain
{
+ public ClassWithEnums()
+ {
+ }
+
public global::Enums.Colors colors { get; set; }
public String NamedValuesColors { get; set; }
@@ -31,12 +43,20 @@ namespace misc
{
public partial class VariousMembers : AXSharp.Connector.IPlain
{
+ public VariousMembers()
+ {
+ }
+
public misc.SomeClass _SomeClass { get; set; } = new misc.SomeClass();
public misc.Motor _Motor { get; set; } = new misc.Motor();
}
public partial class SomeClass : AXSharp.Connector.IPlain
{
+ public SomeClass()
+ {
+ }
+
public string SomeClassVariable { get; set; } = string.Empty;
}
@@ -56,12 +76,23 @@ namespace UnknownArraysShouldNotBeTraspiled
{
public partial class ClassWithArrays : AXSharp.Connector.IPlain
{
+ public ClassWithArrays()
+ {
+#pragma warning disable CS0612
+ AXSharp.Connector.BuilderHelpers.Arrays.InstantiateArray(_complexKnown, () => new UnknownArraysShouldNotBeTraspiled.Complex(), new[] { (0, 10) });
+#pragma warning restore CS0612
+ }
+
public UnknownArraysShouldNotBeTraspiled.Complex[] _complexKnown { get; set; } = new UnknownArraysShouldNotBeTraspiled.Complex[11];
public Byte[] _primitive { get; set; } = new Byte[11];
}
public partial class Complex : AXSharp.Connector.IPlain
{
+ public Complex()
+ {
+ }
+
public string HelloString { get; set; } = string.Empty;
public UInt64 Id { get; set; }
}
diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/configuration.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/configuration.g.cs
index e3e9a9e0..7b5e8249 100644
--- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/configuration.g.cs
+++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/configuration.g.cs
@@ -62,6 +62,10 @@ public partial class unitsTwinController
public partial class ComplexForConfig : AXSharp.Connector.IPlain
{
+ public ComplexForConfig()
+ {
+ }
+
public Boolean myBOOL { get; set; }
public Byte myBYTE { get; set; }
diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/file_with_usings.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/file_with_usings.g.cs
index 0d64ca0c..fb5be2d2 100644
--- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/file_with_usings.g.cs
+++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/file_with_usings.g.cs
@@ -9,6 +9,9 @@ namespace FileWithUsingsSimpleFirstLevelNamespace
{
public partial class Hello : AXSharp.Connector.IPlain
{
+ public Hello()
+ {
+ }
}
}
@@ -16,6 +19,9 @@ namespace FileWithUsingsSimpleQualifiedNamespace.Qualified
{
public partial class Hello : AXSharp.Connector.IPlain
{
+ public Hello()
+ {
+ }
}
}
@@ -25,6 +31,9 @@ namespace FileWithUsingsHelloLevelTwo
{
public partial class Hello : AXSharp.Connector.IPlain
{
+ public Hello()
+ {
+ }
}
}
}
@@ -33,6 +42,9 @@ namespace ExampleNamespace
{
public partial class Hello : AXSharp.Connector.IPlain
{
+ public Hello()
+ {
+ }
}
}
}
\ No newline at end of file
diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/generics.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/generics.g.cs
index cace0f96..9d4a791d 100644
--- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/generics.g.cs
+++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/generics.g.cs
@@ -6,10 +6,17 @@ namespace GenericsTests
{
public partial class Extender : AXSharp.Connector.IPlain
{
+ public Extender()
+ {
+ }
}
public partial class SomeTypeToBeGeneric : AXSharp.Connector.IPlain
{
+ public SomeTypeToBeGeneric()
+ {
+ }
+
public Boolean Boolean { get; set; }
public Int16 Cele { get; set; }
@@ -17,6 +24,10 @@ public partial class SomeTypeToBeGeneric : AXSharp.Connector.IPlain
public partial class Extendee2 : GenericsTests.Extender, AXSharp.Connector.IPlain
{
+ public Extendee2() : base()
+ {
+ }
+
public GenericsTests.SomeTypeToBeGeneric SomeData { get; set; } = new GenericsTests.SomeTypeToBeGeneric();
}
}
diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/makereadonce.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/makereadonce.g.cs
index 9d0c5341..c1f1eb9b 100644
--- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/makereadonce.g.cs
+++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/makereadonce.g.cs
@@ -6,6 +6,10 @@ namespace makereadonce
{
public partial class MembersWithMakeReadOnce : AXSharp.Connector.IPlain
{
+ public MembersWithMakeReadOnce()
+ {
+ }
+
public string makeReadOnceMember { get; set; } = string.Empty;
public string someOtherMember { get; set; } = string.Empty;
public makereadonce.ComplexMember makeReadComplexMember { get; set; } = new makereadonce.ComplexMember();
@@ -14,6 +18,10 @@ public partial class MembersWithMakeReadOnce : AXSharp.Connector.IPlain
public partial class ComplexMember : AXSharp.Connector.IPlain
{
+ public ComplexMember()
+ {
+ }
+
public string someMember { get; set; } = string.Empty;
public string someOtherMember { get; set; } = string.Empty;
}
diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/makereadonly.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/makereadonly.g.cs
index 92deb2e5..f79f845b 100644
--- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/makereadonly.g.cs
+++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/makereadonly.g.cs
@@ -6,6 +6,10 @@ namespace makereadonly
{
public partial class MembersWithMakeReadOnly : AXSharp.Connector.IPlain
{
+ public MembersWithMakeReadOnly()
+ {
+ }
+
public string makeReadOnceMember { get; set; } = string.Empty;
public string someOtherMember { get; set; } = string.Empty;
public makereadonly.ComplexMember makeReadComplexMember { get; set; } = new makereadonly.ComplexMember();
@@ -14,6 +18,10 @@ public partial class MembersWithMakeReadOnly : AXSharp.Connector.IPlain
public partial class ComplexMember : AXSharp.Connector.IPlain
{
+ public ComplexMember()
+ {
+ }
+
public string someMember { get; set; } = string.Empty;
public string someOtherMember { get; set; } = string.Empty;
}
diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/misc.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/misc.g.cs
index 1932346a..1590c14c 100644
--- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/misc.g.cs
+++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/misc.g.cs
@@ -6,6 +6,10 @@ namespace Enums
{
public partial class ClassWithEnums : AXSharp.Connector.IPlain
{
+ public ClassWithEnums()
+ {
+ }
+
public global::Enums.Colors colors { get; set; }
public String NamedValuesColors { get; set; }
@@ -16,12 +20,20 @@ namespace misc
{
public partial class VariousMembers : AXSharp.Connector.IPlain
{
+ public VariousMembers()
+ {
+ }
+
public misc.SomeClass _SomeClass { get; set; } = new misc.SomeClass();
public misc.Motor _Motor { get; set; } = new misc.Motor();
}
public partial class SomeClass : AXSharp.Connector.IPlain
{
+ public SomeClass()
+ {
+ }
+
public string SomeClassVariable { get; set; } = string.Empty;
}
@@ -41,12 +53,23 @@ namespace UnknownArraysShouldNotBeTraspiled
{
public partial class ClassWithArrays : AXSharp.Connector.IPlain
{
+ public ClassWithArrays()
+ {
+#pragma warning disable CS0612
+ AXSharp.Connector.BuilderHelpers.Arrays.InstantiateArray(_complexKnown, () => new UnknownArraysShouldNotBeTraspiled.Complex(), new[] { (0, 10) });
+#pragma warning restore CS0612
+ }
+
public UnknownArraysShouldNotBeTraspiled.Complex[] _complexKnown { get; set; } = new UnknownArraysShouldNotBeTraspiled.Complex[11];
public Byte[] _primitive { get; set; } = new Byte[11];
}
public partial class Complex : AXSharp.Connector.IPlain
{
+ public Complex()
+ {
+ }
+
public string HelloString { get; set; } = string.Empty;
public UInt64 Id { get; set; }
}
diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/mixed_access.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/mixed_access.g.cs
index 5ec06fdf..c621e94c 100644
--- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/mixed_access.g.cs
+++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/mixed_access.g.cs
@@ -17,6 +17,10 @@ public partial class unitsTwinController
public partial class Motor : AXSharp.Connector.IPlain
{
+ public Motor()
+ {
+ }
+
public Boolean Run { get; set; }
}
@@ -42,6 +46,10 @@ public partial class struct4
public partial class AbstractMotor : AXSharp.Connector.IPlain
{
+ public AbstractMotor()
+ {
+ }
+
public Boolean Run { get; set; }
public Boolean ReverseDirection { get; set; }
@@ -49,9 +57,15 @@ public partial class AbstractMotor : AXSharp.Connector.IPlain
public partial class GenericMotor : AbstractMotor, AXSharp.Connector.IPlain
{
+ public GenericMotor() : base()
+ {
+ }
}
public partial class SpecificMotorA : GenericMotor, AXSharp.Connector.IPlain
{
+ public SpecificMotorA() : base()
+ {
+ }
}
}
\ No newline at end of file
diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/ref_to_simple.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/ref_to_simple.g.cs
index d74190dc..4630b8fe 100644
--- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/ref_to_simple.g.cs
+++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/ref_to_simple.g.cs
@@ -6,10 +6,17 @@ namespace RefToSimple
{
public partial class ref_to_simple : AXSharp.Connector.IPlain
{
+ public ref_to_simple()
+ {
+ }
}
public partial class referenced : AXSharp.Connector.IPlain
{
+ public referenced()
+ {
+ }
+
public Int16 b { get; set; }
}
}
diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/simple_empty_class.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/simple_empty_class.g.cs
index 9152919c..116388ce 100644
--- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/simple_empty_class.g.cs
+++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/simple_empty_class.g.cs
@@ -4,5 +4,8 @@ namespace Pocos
{
public partial class simple_class : AXSharp.Connector.IPlain
{
+ public simple_class()
+ {
+ }
}
}
\ No newline at end of file
diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/simple_empty_class_within_namespace.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/simple_empty_class_within_namespace.g.cs
index bfd3aa47..2121558e 100644
--- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/simple_empty_class_within_namespace.g.cs
+++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/simple_empty_class_within_namespace.g.cs
@@ -6,6 +6,9 @@ namespace sampleNamespace
{
public partial class simple_empty_class_within_namespace : AXSharp.Connector.IPlain
{
+ public simple_empty_class_within_namespace()
+ {
+ }
}
}
}
\ No newline at end of file
diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/type_named_values.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/type_named_values.g.cs
index b0475f4d..1713fdcc 100644
--- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/type_named_values.g.cs
+++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/type_named_values.g.cs
@@ -6,6 +6,10 @@ namespace NamedValuesNamespace
{
public partial class using_type_named_values : AXSharp.Connector.IPlain
{
+ public using_type_named_values()
+ {
+ }
+
public Int16 LColors { get; set; }
}
}
diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/type_named_values_literals.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/type_named_values_literals.g.cs
index fc3c00bb..ab706cf6 100644
--- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/type_named_values_literals.g.cs
+++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/type_named_values_literals.g.cs
@@ -6,6 +6,10 @@ namespace Simatic.Ax.StateFramework
{
public partial class using_type_named_values : AXSharp.Connector.IPlain
{
+ public using_type_named_values()
+ {
+ }
+
public UInt16 LColors { get; set; }
}
}
diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/type_with_enum.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/type_with_enum.g.cs
index 1deabc4a..59a91df6 100644
--- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/type_with_enum.g.cs
+++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/type_with_enum.g.cs
@@ -13,6 +13,10 @@ namespace Simatic.Ax.StateFramework
{
public partial class CompareGuardLint : AXSharp.Connector.IPlain, IGuard
{
+ public CompareGuardLint()
+ {
+ }
+
public Int64 CompareToValue { get; set; }
public global::Simatic.Ax.StateFramework.Condition Condition { get; set; }
diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/types_with_name_attributes.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/types_with_name_attributes.g.cs
index 6dce8390..2dcf9ee6 100644
--- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/types_with_name_attributes.g.cs
+++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/types_with_name_attributes.g.cs
@@ -17,6 +17,10 @@ public partial class Vehicle
public partial class NoAccessModifierClass : AXSharp.Connector.IPlain
{
+ public NoAccessModifierClass()
+ {
+ }
+
public string SomeClassVariable { get; set; } = string.Empty;
}
}
diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/types_with_property_attributes.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/types_with_property_attributes.g.cs
index 9fb059c8..a8b8283f 100644
--- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/types_with_property_attributes.g.cs
+++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/types_with_property_attributes.g.cs
@@ -6,6 +6,10 @@ namespace TypesWithPropertyAttributes
{
public partial class SomeAddedProperties : AXSharp.Connector.IPlain
{
+ public SomeAddedProperties()
+ {
+ }
+
public Int16 Counter { get; set; }
}
}
diff --git a/src/AXSharp.connectors/src/AXSharp.Connector/BuilderHelpers/Arrays.cs b/src/AXSharp.connectors/src/AXSharp.Connector/BuilderHelpers/Arrays.cs
index 4753609d..a13b0c47 100644
--- a/src/AXSharp.connectors/src/AXSharp.Connector/BuilderHelpers/Arrays.cs
+++ b/src/AXSharp.connectors/src/AXSharp.Connector/BuilderHelpers/Arrays.cs
@@ -59,6 +59,29 @@ public static class Arrays
}
}
+ [Obsolete("Internal use only")]
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static void InstantiateArray(this Array array,
+ Func