Skip to content

Commit

Permalink
properly fix scoped name for generic arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
LukeFZ committed Feb 27, 2024
1 parent 1e27f86 commit b21b6e8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
10 changes: 5 additions & 5 deletions Il2CppInspector.CLI/Il2CppInspector.CLI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<Version>2023.1</Version>
<Company>Noisy Cow Studios</Company>
<Product>Il2CppInspector Command-Line Edition</Product>
<Copyright>(c) 2017-2021 Katy Coe - www.djkaty.com - www.github.com/djkaty</Copyright>
<PackageId>Il2CppInspector.CLI</PackageId>
<Authors>Katy Coe</Authors>
<Company>LukeFZ, Noisy Cow Studios</Company>
<Product>Il2CppInspectorRedux Command-Line Edition</Product>
<Copyright>(c) 2023-2024 LukeFZ - https://github.com/LukeFZ, original (c) 2017-2021 Katy Coe - www.djkaty.com - www.github.com/djkaty</Copyright>
<PackageId>Il2CppInspectorRedux.CLI</PackageId>
<Authors>LukeFZ, Katy Coe</Authors>
<AssemblyName>Il2CppInspector</AssemblyName>
</PropertyGroup>

Expand Down
10 changes: 4 additions & 6 deletions Il2CppInspector.Common/Reflection/TypeInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -414,10 +414,6 @@ public string FullName {
// Returns the minimally qualified type name required to refer to this type within the specified scope
private string getScopedFullName(Scope scope)
{
// Generic type parameters take precedence over all other names, so if FullName is null (== generic) we can just return the name itself
if (FullName == null)
return this.Name;

// This is the type to be used (generic type parameters have a null FullName)
var usedType = FullName.Replace('+', '.');

Expand Down Expand Up @@ -581,8 +577,8 @@ public string GetScopedCSharpName(Scope usingScope = null, bool omitRef = false,
if (usingScope == null)
return CSharpName;

// Generic parameters don't have a scope
if (IsGenericParameter)
// Generic parameters (or generic arrays) don't have a scope
if (HasNoScope)
return CSharpName;

var s = Namespace + "." + base.Name;
Expand Down Expand Up @@ -716,6 +712,8 @@ public IEnumerable<TypeInfo> ImplementedInterfaces {
// Helper function for determining if using this type as a field, parameter etc. requires that field or method to be declared as unsafe
public bool RequiresUnsafeContext => IsPointer || (HasElementType && ElementType.RequiresUnsafeContext);

public bool HasNoScope => IsGenericParameter || (HasElementType && ElementType.HasNoScope);

// May get overridden by Il2CppType-based constructor below
public override MemberTypes MemberType { get; } = MemberTypes.TypeInfo;

Expand Down

0 comments on commit b21b6e8

Please sign in to comment.