hazzik / DelegateDecompiler

A library which is able to decompile a delegate or a method body to its lambda representation
MIT License
522 stars 62 forks source link

Fix decompilation issue of constrainded generics #198

Closed cmeyertons closed 1 year ago

cmeyertons commented 1 year ago

Please see the failing test, added another implementation of IPerson and the query start failing. The decompile works appropriately when there is only one implementation of the interface. Otherwise, it creates a weird expression that is doing ternaries on each individual implementation.

cmeyertons commented 1 year ago

Alright this is my rough implementation, very open to feedback, but it does resolve the issue.

hazzik commented 1 year ago

This has been released in 0.31.0. Please consider ❤️ supporting the project.