Skip to content

Commit

Permalink
.NET: Fix System->app reference (why)
Browse files Browse the repository at this point in the history
  • Loading branch information
praydog committed Mar 30, 2024
1 parent 2be442c commit 3ea871c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
9 changes: 9 additions & 0 deletions csharp-api/AssemblyGenerator/ClassGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
using System.Security.Cryptography;
using System.Linq;
using Microsoft.CodeAnalysis.Operations;
using REFrameworkNET;


public class ClassGenerator {
Expand Down Expand Up @@ -162,10 +163,18 @@ public ClassGenerator(string className_, REFrameworkNET.TypeDefinition t_, REFra
// Stuff in System should NOT be referencing via
// how is this even compiling for them?
if (ogClassName.StartsWith("System") && methodReturnName.StartsWith("via")) {
REFrameworkNET.API.LogWarning("Method " + ogClassName + "." + method.Name + " is referencing via class " + methodReturnName);
returnType = SyntaxFactory.PredefinedType(SyntaxFactory.Token(SyntaxKind.ObjectKeyword));
break;
}

if (ogClassName.StartsWith("System") && methodReturnName.StartsWith("app.")) {
REFrameworkNET.API.LogWarning("Method " + ogClassName + "." + method.Name + " is referencing app class " + methodReturnName);
returnType = SyntaxFactory.PredefinedType(SyntaxFactory.Token(SyntaxKind.ObjectKeyword));
break;
}


methodReturnName = "global::" + REFrameworkNET.AssemblyGenerator.CorrectTypeName(methodReturnName);

returnType = SyntaxFactory.ParseTypeName(methodReturnName);
Expand Down
2 changes: 2 additions & 0 deletions csharp-api/AssemblyGenerator/Generator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,8 @@ [.. methods]
strippedAssemblyName = "_System";
}

REFrameworkNET.API.LogInfo("Generating assembly " + strippedAssemblyName);

List<CompilationUnitSyntax> compilationUnits = [];
var tdb = REFrameworkNET.API.GetTDB();

Expand Down

0 comments on commit 3ea871c

Please sign in to comment.