Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IL2CPP generation error for this[] operator override setter #621

Open
Pfhoenix opened this issue Mar 16, 2024 · 5 comments
Open

IL2CPP generation error for this[] operator override setter #621

Pfhoenix opened this issue Mar 16, 2024 · 5 comments
Labels
Bug Something isn't working Wont Fix Issue is unable to be fixed or is not scheduled to be fixed.

Comments

@Pfhoenix
Copy link

Pfhoenix commented Mar 16, 2024

Important

If General, Description, and Replication are not completed the issue will be closed immediately.

General
Unity version: 2022.3.15f1
Fish-Networking version: 4.1.2R
Discord link: https://discord.com/channels/424284635074134018/1034477094731784302/1218299786860695752

Description
In my custom class, I override the array accessor operator, []. Getter works fine, but having a setter results in the error in the attached text file.

il2cpp build error.txt

The related code is as follows :

Dictionary<Guid, MyClass> Foo = new();

public MyClass this[Guid id]
{
  get
  {
    if (Foo.TryGetValue(id, out MyClass mc)) return mc;
    return null;
  }

  set
  {
    Foo[id] = value;
  }
}

Where serialization is happening for the broadcast struct:

public class ManageMyClass
{
  public List<MyClass> MyList;
}

struct BroadcastMe
{
  public ManageMyClass Manager;
}

Replication
Steps to reproduce the behavior:

  1. Create a project with a class using the code above
  2. Build the project with IL2CPP target
  3. Observe error in log

Expected behavior
I'd expect no error with building the code above. It's fundamental and simple C# code.

@FirstGearGames
Copy link
Owner

Are you serializing MyClass anywhere? EG: RPC, SyncVar, Broadcast

@FirstGearGames FirstGearGames added the Waiting For Information Not enough information has been supplied to resolve this issue. label Mar 20, 2024
@Pfhoenix
Copy link
Author

Yes, it's in a broadcast struct.

@FirstGearGames
Copy link
Owner

Please update original post to show the struct.

@FirstGearGames
Copy link
Owner

Thanks!

@FirstGearGames FirstGearGames added Acknowledged - Maybe Bug Your issue has been acknowledged as a potential bug and will be investigated. and removed Waiting For Information Not enough information has been supplied to resolve this issue. labels Mar 24, 2024
@FirstGearGames
Copy link
Owner

I'm going to mark this as wont fix but keep it open because Id like to see if our new serializer generation tech will fix this.

@FirstGearGames FirstGearGames added Bug Something isn't working Wont Fix Issue is unable to be fixed or is not scheduled to be fixed. and removed Acknowledged - Maybe Bug Your issue has been acknowledged as a potential bug and will be investigated. labels Oct 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Wont Fix Issue is unable to be fixed or is not scheduled to be fixed.
Projects
None yet
Development

No branches or pull requests

2 participants