InjectFix icon indicating copy to clipboard operation
InjectFix copied to clipboard

Fix field type collection when meeting T[] or Generic<T> fields

Open UlyssesWu opened this issue 1 year ago • 2 comments

The commit 9d8e950 is an uncomplete fix due to lack consideration of array and generic instance type fields in a generic base class. This commit will get it fixed.

Can be examined with this code:

abstract class Generic<T>
{
  T[] Field1;
  List<T> Field2;
}

class GenericString : Generic<string>
{
  [IFix.Patch]
  public void Test()
  {
    Field1 = new string[] {"Test"};
    Field2 = new List<string> {"Test"};
    Debug.Log(Field1[0]);
    Debug.Log(Field2[0]);
  }
}

UlyssesWu avatar Nov 06 '24 17:11 UlyssesWu

CLA assistant check
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

tencent-adm avatar Nov 06 '24 17:11 tencent-adm

CLA assistant check Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.

Of course I REFUSE to sign. 😤 That's to say, I do NOT grant Copyright or Patent license to Tencent, regardless of whether this PR got merged, or the maintainers committed code referenced to my code.

UlyssesWu avatar Nov 06 '24 17:11 UlyssesWu