Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BoxedWrapper fails for opaque record types #957

Closed
cameronwhite opened this issue Sep 16, 2023 · 1 comment
Closed

BoxedWrapper fails for opaque record types #957

cameronwhite opened this issue Sep 16, 2023 · 1 comment
Labels
bug Something isn't working
Milestone

Comments

@cameronwhite
Copy link
Contributor

While testing out the 0.5.0-preview.1 release with Pinta, I noticed that value.GetBoxed(Gdk.FileList.GetGType()) is now throwing an exception.

Adding the following code to the OpaqueTypedRecordTest reproduces the same error:

    [TestMethod]
    public void SupportsWrapHandle()
    {
        var recordTester = OpaqueTypedRecordTester.New();

        var wrapped = (OpaqueTypedRecordTester) GObject.Internal.BoxedWrapper.WrapHandle(
                handle: recordTester.Handle.DangerousGetHandle(),
                ownsHandle: false,
                gtype: OpaqueTypedRecordTester.GetGType()
        );

        wrapped.Handle.Should().Be(recordTester.Handle);
    }

Error message:

System.Exception: Type GirTest.OpaqueTypedRecordTester does not define an IntPtr constructor. This could mean improperly defined bindings

It looks like the reflection is failing because opaque records no longer have the constructor signature it's looking for?

@badcel badcel added the bug Something isn't working label Sep 17, 2023
@badcel badcel added this to the 0.5.0 milestone Sep 17, 2023
@badcel
Copy link
Member

badcel commented Sep 17, 2023

Thank you for the report. This should be kept in mind for all kinds of boxed records (opaque / not opaque)

@badcel badcel closed this as completed Jan 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants