Remove methods from type
See original GitHub issueHello all!
I need a help again 😃 How to remove methods from a type? I’m trying to delete them like this (just example):
if (type.HasMethods) { for (int i = 0; i < type.Methods.Count; i++) { MethodDef method = type.Methods[i]; type.Methods.Remove(method); } }
I see in debugger that method is removed from type.Methods list, but after saving assembly all methods are in the type.
Any ideas? Thanks in advance!
Issue Analytics
- State:
- Created 6 years ago
- Comments:5
Top Results From Across the Web
Type transformations in TypeScript: Removing functions from ...
In today's post, we are going the create a utility class for removing functions from a type. The technique can be used for...
Read more >How to omit methods from a class type
You can remove functions from a type, but this will unfortunately remove fields that are functions as well: type OmitFunctions<T> = { [P...
Read more >Type to remove methods from interface in Typescript
Type to remove methods from interface in Typescript - remove-methods-from-interface.ts.
Read more >Documentation - Utility Types
Constructs a type by picking all properties from Type and then removing Keys (string literal or union of string literals). The opposite of...
Read more >Update `.lean` type to automatically remove methods from ...
the problem is when using something like a class (especially in typegoose) where there are properties and methods on the same type, it...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You don’t even need a loop if you’re removing every method, just call
type.Methods.Clear()
.Fu***ing .NET! I had to iterate my collection backwards. Oh, God!