-
-
Notifications
You must be signed in to change notification settings - Fork 450
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
cannot compile interface with generic type parameter #277
Comments
Hello, This issue occurs due to a type naming behavior of the C# compiler. When you compile interface When we create the interface through dnSpy, call it The simple fix is to ensure that the type names match the naming convention used by the C# compiler for types with generic parameters and add the backticks and generic parameter numbers when changing the number of generic parameters. Something to avoid such mishaps in the future could be added too, perhaps a message box when editing a type that gives the option to automatically update the type name? Hope this explains the issue well and provides a solution to your problem! |
Sorry, as I struggle with this right now, please elaborate on what is needed to be done in order to compile changed code. EDIT: I have a class named |
@ElektroKill, could you please lend me a hand with this? |
Note: If you created a new class in dnSpy and then try to use it when editing a completely different type in C# editor it most likely will not work due to a limitation in the current implementation of the C# editor. |
dnSpyEx version
6.4.1
Describe the Bug
When trying to compile an interface with a generic type parameter, an error is thrown that the edited interface could not be found.
How To Reproduce
Create an interface, then give it a generic type parameter either by editing the code or through the 'Generic Params' tab from the 'Edit Type' menu. Trying to compile the interface should now throw an error.
Expected Behavior
The interface gets compiled and has a generic type parameter.
Actual Behavior
Compiling throws an error
Additional Context
The text was updated successfully, but these errors were encountered: