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

Can't create HashSet with collection initialiser in mods #3525

Open
ChristianLW opened this issue Nov 30, 2024 · 0 comments
Open

Can't create HashSet with collection initialiser in mods #3525

ChristianLW opened this issue Nov 30, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@ChristianLW
Copy link

Describe the bug

In mod code you can create an empty HashSet, but you can't use the collection initialiser syntax, for example:

HashSet<string> testSet = new HashSet<string> { "Test" };

This will give an error when compiling, saying that an assembly reference is missing for the ISet<> type.

I think the fix is just to include

typeof(ISet<>).Assembly.Location

in the assemblyLocations array in the ModLoader class, although I can't test this myself.

Clearly describe how to reproduce the bug

Simply include the collection initialiser syntax in the code for a mod.

Game debug info

exported game debug info.md

Mod list

No response

Game version

No response

Operating System

No response

Additional notes

No response

@ChristianLW ChristianLW added the bug Something isn't working label Nov 30, 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
Projects
None yet
Development

No branches or pull requests

2 participants