CS: Fix "Namespace used like type" (CS0118) (needs additional work)

This commit is contained in:
Katy Coe
2020-06-22 22:35:32 +02:00
parent ef22c6628b
commit 42310483af
2 changed files with 27 additions and 0 deletions

View File

@@ -16,6 +16,9 @@ namespace Il2CppInspector.Reflection
public Il2CppInspector Package { get; }
public List<Assembly> Assemblies { get; } = new List<Assembly>();
// List of all namespaces defined by the application
public List<string> Namespaces { get; }
// List of all types from TypeDefs ordered by their TypeDefinitionIndex
public TypeInfo[] TypesByDefinitionIndex { get; }
@@ -113,6 +116,9 @@ namespace Il2CppInspector.Reflection
GenericMethods[spec] = method;
}
// Generate a list of all namespaces used
Namespaces = Assemblies.SelectMany(x => x.DefinedTypes).GroupBy(t => t.Namespace).Select(n => n.Key).Distinct().ToList();
// Find all custom attribute generators (populate AttributesByIndices) (use ToList() to force evaluation)
var allAssemblyAttributes = Assemblies.Select(a => a.CustomAttributes).ToList();
var allTypeAttributes = TypesByDefinitionIndex.Select(t => t.CustomAttributes).ToList();