Skip to content

[ffigen][objective_c] Adding header for superclass causes the constructor to not be generated #2656

@orestesgaolin

Description

@orestesgaolin

This is happening during the same generation as in #2655 but it's a separate issue.

Sample code and commit: https://github.com/orestesgaolin/native_interop_presentation/tree/a3c110fd151a4528bc3ed1d2d8db449cb57177ae/uikit

Problem

Once I added UIWindow.h header file to input files, some subclasses no longer are having new() constructor generated.

Reproduction steps

  1. Comment out in pubspec.yaml # - "/Users/dominik/Projects/_personal/plugins_presentation/uikit/Headers/UIWindow.h"
  2. Run dart run ffigen
  3. Observe that UIScrollView has factory UIScrollView() => new$();
  4. Uncomment - "/Users/dominik/Projects/_personal/plugins_presentation/uikit/Headers/UIWindow.h"
  5. Run dart run ffigen
  6. Observe that UIScrollView no longer has new constructor

Workaround

Just adding them manually

Dependencies

dependencies:
  ffi: ^2.1.4
  flutter:
    sdk: flutter
  objective_c: ^9.0.0-dev.0

dev_dependencies:
  ffigen: ^20.0.0-dev.0

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions