Skip to content

[vm/ffi] FfiNative return types treatment inconsistent with asFunction #49518

Open
@dcharkes

Description

@dcharkes
@FfiNative<Handle Function()>('doesntmatter')
external String? doesntmatter();

https://dart-review.googlesource.com/c/sdk/+/252601/6/pkg/vm/testcases/transformations/ffi/ffinative.dart

asFunction and lookupFunction do not allow the return type to be sticter than Object when the native type is Handle.

The old natives do allow the return type to be stricter than Object.

It would be good to update FfiNatives to be consistent with asFunction, but that would make them inconsistent with old natives.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-vmUse area-vm for VM related issues, including code coverage, and the AOT and JIT backends.library-ffivm-native

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions