[TIMOB-24102] Windows: Native method resolution and casting
GitHub Issue | n/a |
---|---|
Type | Improvement |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2016-12-20T17:24:19.000+0000 |
Affected Version/s | Release 5.4.0 |
Fix Version/s | Release 6.1.0 |
Components | Windows |
Labels | n/a |
Reporter | Kota Iguchi |
Assignee | Kota Iguchi |
Created | 2016-11-04T06:46:50.000+0000 |
Updated | 2017-03-02T23:25:29.000+0000 |
Description
If a class has overloads for a method (multiple forms of the method with different signatures, but the same name), we need to attempt to match the correct method to invoke on the C# side by matching the passed in arguments to the closest match. Typically, this involves matching the name, number of arguments and the ability to convert the passed in arguments (in-order) to the method’s parameter types. We might want to slightly more liberal in accepting numeric primitives than typical method resolution due to the conversion of JS Numbers.
Also, sometimes interfaces define generic return types such as Object and you will need to cast them to a different type to then reference methods and properties of the class. You can pass along the object you want to wrap to the constructor of the type you want to wrap it in.
https://github.com/appcelerator/hyperloop.next/pull/112
Environment: NPM Version: 2.15.9 Node Version: 4.6.0 Windows OS: 10.0.14393.693 Appc CLI: 6.1.0 Appc CLI NPM: 4.2.8 Titanium SDK version: 6.1.0.v20170227120704 Appcelerator Studio, build: 4.8.1.201612050850 Windows Device: 8.1 and 10.0.14393 Windows Emulator 8.1 and 10.0.14393 I tested the demo apps, and validated the fix. There were two pull requests for this ticket; I tested with the demo apps from both PR's.