Title: fix(winrt): unsealed class returns and static method overloads by triniwiz · Pull Request #55 · NativeScript/windows · GitHub
Open Graph Title: fix(winrt): unsealed class returns and static method overloads by triniwiz · Pull Request #55 · NativeScript/windows
X Title: fix(winrt): unsealed class returns and static method overloads by triniwiz · Pull Request #55 · NativeScript/windows
Description: Two projection fixes in calls to WinRT statics and their return values. Unsealed class returns A method whose declared return type is a class others can derive from came back as a wrapper of the declared class. The runtime class was never asked for. VisualTreeHelper.GetParent declares DependencyObject and returns a Grid, which came back without IsHitTestVisible or any other Grid member. An unsealed declared class now resolves the runtime class, as interface returns already did. Both engines: return_value_from_kind (classic) and create_instance_proxy (Node-API). Static overloads Statics had no overload selection. The constructor held one function per name, bound to whichever overload came first in metadata, and [Overload] names were not exposed for statics. So VisualTreeHelper.FindElementsInHostCoordinates(point, element) could reach the Rect overload. Statics are now grouped by name and the overload is picked per call: by argument count (trailing out parameters may be left off); then by the struct whose fields an object argument has, preferring the most fields matched; then [DefaultOverload], then metadata order. Their [Overload] names (FindElementsInHostCoordinatesPoint, ...Rect) are exposed too, as for instance methods. The Node-API engine's instance and constructor overloads use the same selection (class_helpers::pick_overload). Verified On Windows 11, in the NativeScript canvas demo with this build: VisualTreeHelper.GetParent of a hosted view returns a Microsoft.UI.Xaml.Controls.Grid. FindElementsInHostCoordinates(Point, UIElement) and FindElementsInHostCoordinates(Rect, UIElement) return the same element counts as FindElementsInHostCoordinatesPoint and FindElementsInHostCoordinatesRect called by name. The canvas spec suite passes, including the HTML-in-Canvas hit tests, which call FindElementsInHostCoordinates(Point, UIElement). cargo build -p nativescript --release (classic) and cargo check -p runtime --no-default-features --features napi_engine for x86_64-pc-windows-msvc. Tested together with #54, which the canvas addons need to load.
Open Graph Description: Two projection fixes in calls to WinRT statics and their return values. Unsealed class returns A method whose declared return type is a class others can derive from came back as a wrapper of the de...
X Description: Two projection fixes in calls to WinRT statics and their return values. Unsealed class returns A method whose declared return type is a class others can derive from came back as a wrapper of the de...
Opengraph URL: https://github.com/NativeScript/windows/pull/55
X: @github
Domain: github.com
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:8d90b770-3335-cf68-50ea-fa93292d5d45 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | D2F6:65478:204FEFE:2AD14B4:6B0176D6 |
| html-safe-nonce | 1cd35f14ef71007bcb5e0ca1fc0c72882c5057bfaefcf9e18a45e9f75754bb59 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMkY2OjY1NDc4OjIwNEZFRkU6MkFEMTRCNDo2QjAxNzZENiIsInZpc2l0b3JfaWQiOiI0NDIwNzQ0NjUwNTU0NDM5MzgyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | f449daaf8d3f324f4fd9e86ffff6c2cb2ee5a91e5047d4cfc1323d2ed4b029c3 |
| hovercard-subject-tag | pull_request:5405313812 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/NativeScript/windows/pull/55/files |
| twitter:image | https://avatars.githubusercontent.com/u/6695919?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/6695919?s=400&v=4 |
| og:image:alt | Two projection fixes in calls to WinRT statics and their return values. Unsealed class returns A method whose declared return type is a class others can derive from came back as a wrapper of the de... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/NativeScript/windows git https://github.com/NativeScript/windows.git |
| octolytics-dimension-user_id | 7392261 |
| octolytics-dimension-user_login | NativeScript |
| octolytics-dimension-repository_id | 373653886 |
| octolytics-dimension-repository_nwo | NativeScript/windows |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 373653886 |
| octolytics-dimension-repository_network_root_nwo | NativeScript/windows |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width