From 3ea871c8eb7d39ce678d55d70bc8a371df1d0de7 Mon Sep 17 00:00:00 2001 From: praydog Date: Sat, 30 Mar 2024 01:13:58 -0700 Subject: [PATCH] .NET: Fix System->app reference (why) --- csharp-api/AssemblyGenerator/ClassGenerator.cs | 9 +++++++++ csharp-api/AssemblyGenerator/Generator.cs | 2 ++ 2 files changed, 11 insertions(+) diff --git a/csharp-api/AssemblyGenerator/ClassGenerator.cs b/csharp-api/AssemblyGenerator/ClassGenerator.cs index 8a7af81d5..d0e55e574 100644 --- a/csharp-api/AssemblyGenerator/ClassGenerator.cs +++ b/csharp-api/AssemblyGenerator/ClassGenerator.cs @@ -11,6 +11,7 @@ using System.Security.Cryptography; using System.Linq; using Microsoft.CodeAnalysis.Operations; +using REFrameworkNET; public class ClassGenerator { @@ -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); diff --git a/csharp-api/AssemblyGenerator/Generator.cs b/csharp-api/AssemblyGenerator/Generator.cs index e2c46be68..7d0aa0648 100644 --- a/csharp-api/AssemblyGenerator/Generator.cs +++ b/csharp-api/AssemblyGenerator/Generator.cs @@ -370,6 +370,8 @@ [.. methods] strippedAssemblyName = "_System"; } + REFrameworkNET.API.LogInfo("Generating assembly " + strippedAssemblyName); + List compilationUnits = []; var tdb = REFrameworkNET.API.GetTDB();