Skip to content

Commit

Permalink
.NET: Initial correct types for parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
praydog committed Apr 6, 2024
1 parent acee01a commit 89614c3
Showing 1 changed file with 23 additions and 23 deletions.
46 changes: 23 additions & 23 deletions csharp-api/AssemblyGenerator/ClassGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -124,31 +124,31 @@ private static TypeSyntax MakeProperType(REFrameworkNET.TypeDefinition? targetTy
return outSyntax;
}

static readonly SortedSet<string> invalidMethodNames = [
"Finalize",
"MemberwiseClone",
"ToString",
"Equals",
"GetHashCode",
"GetType",
".ctor",
".cctor",
"op_Implicit",
"op_Explicit",
/*"op_Addition",
"op_Subtraction",
"op_Multiply",
"op_Division",
"op_Modulus",
"op_BitwiseAnd",
"op_BitwiseOr",
"op_ExclusiveOr",*/

];

private TypeDeclarationSyntax? Generate() {
usingTypes = [];

SortedSet<string> invalidMethodNames = new SortedSet<string> {
"Finalize",
"MemberwiseClone",
"ToString",
"Equals",
"GetHashCode",
"GetType",
".ctor",
".cctor",
"op_Implicit",
"op_Explicit",
/*"op_Addition",
"op_Subtraction",
"op_Multiply",
"op_Division",
"op_Modulus",
"op_BitwiseAnd",
"op_BitwiseOr",
"op_ExclusiveOr",*/

};

var ogClassName = new string(className);

// Pull out the last part of the class name (split '.' till last)
Expand Down Expand Up @@ -212,7 +212,7 @@ private static TypeSyntax MakeProperType(REFrameworkNET.TypeDefinition? targetTy
if (method.Parameters.Count > 0) {
methodDeclaration = methodDeclaration.AddParameterListParameters(method.Parameters.Where(param => param != null && param.Type != null && param.Name != null).Select(param => {
return SyntaxFactory.Parameter(SyntaxFactory.Identifier(param.Name ?? "UnknownParam"))
.WithType(SyntaxFactory.ParseTypeName(/*param.Type ??*/ "object"));
.WithType(SyntaxFactory.ParseTypeName(param.Type != null ? MakeProperType(param.Type, t).ToString() : "object"));
}).ToArray());
}

Expand Down

0 comments on commit 89614c3

Please sign in to comment.