Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(dotnet): fix callback issues (#953)
* fix(dotnet): fix callback issues Corrects an issue with handling callbacks in various situations: - When a callback for a method with optional parameters was invoked with some of the optional parameters not specified, an argument count mismatch error would occur. This is because dotnet reflection requires all arguments to be provided (with `null` if needed). - When a callback for a variadic method was invoked, a type mismatch or a parameter count mismatch error would occur. This is because the variadic parameter is an array of it's value type, and has to be passed this way out to the reflection call. - Objects would be created in Javascript without interface annotations, causing type information to be lost and incorrect callback argument serialization could happen in the Kernel. - When a class implements members from an interface (and only from one), the overrides would not be correctly identified, as the Attributes on interface members are *not* visible on the implementors (whereas they are visible when they were on an extended class member!). - Invalid type coertion could happen within the callback handling logic in certain edge cases. The complete type information is available, so switched to using the full conversion gear form the jsii runtime to achieve correct results. All of those issues are fairly inter-linked and it was difficult to fix them individually & issue a test that would not break due to another of the issues... Hence the fixes are grouped in a single commit. * fixup test expectations I had forgot to care about 🤷🏻♂️
- Loading branch information