Repository navigation
fix(metadata): IIDs of generics over classes with a generic default interface - #45
Merged
Merged
Conversation
…nterface A class whose default interface is itself generic, such as DeviceInformationCollection (IVectorView<DeviceInformation>), had no wire signature: ClassDeclaration::default_interface() only returns plain interfaces, so IAsyncOperation<DeviceInformationCollection> got a zero IID. The QueryInterface for it failed, and on napi toPromise(DeviceInformation.FindAllAsync(...)) rejected with "interface property 'Completed' construction failed". The class signature now embeds the default interface's own pinterface(...) signature, as WinRT specifies; a test checks the result against RoGetParameterizedTypeInstanceIID. The metadata locator, which only the tests use, handles such classes with SetRuntimeClassParameterizedDefault instead of unwrapping.
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On napi,
NSWinRT.toPromise(DeviceInformation.FindAllAsync(...))rejected with "interface property 'Completed' construction failed".DeviceInformationCollection's default interface is itself generic (IVectorView<DeviceInformation>).ClassDeclaration::default_interface()only returns plain interfaces, sowire_signature_for_namehad no signature for the class.IAsyncOperation<DeviceInformationCollection>then got a zero IID, and the QueryInterface forCompletedfailed.WinRT signs a class as
rc(Name;<default interface signature>), where a generic default interface contributes its fullpinterface(...)signature. The class arm now does that throughdefault_interface_full_name(). This applies to every class whose default interface is a generic instance; many*Collectionclasses are like this.The metadata locator (which only the tests use) also unwrapped
default_interface(). It now handles these classes withSetRuntimeClassParameterizedDefault, so a test can compare our IID withRoGetParameterizedTypeInstanceIID.Testing
IAsyncOperation<DeviceInformationCollection>matches the OS.toPromise(DeviceInformation.FindAllAsync('', ['System.Devices.HardwareIds'], DeviceInformationKind.Device))resolves on napi (256 devices here); onmainit rejects.npm test: 442/442.cargo test -p runtime --lib: same failures asmain.