Skip to content

[pigeon] void @HostApi @async methods will generate invalid void return on Java methods #78536

Closed
flutter/packages
#316

Description

@matejdro

Steps to Reproduce

  1. Write following pigeon definition
@HostApi()
abstract class MyClass {
  @async
  void myMethod();
}
  1. Compile pigeons
  2. Observe compiled java file

Expected results:

Void pigeon method should return a valid result type, for example Result<Void> (capital V).

Actual results:

Java method will accept Result<void> return type which is not valid in Java language:

image

cc @gaaclarke (as requested in the pigeon feedback)

Activity

  1. pedromassangocode commented on Mar 18, 2021

    @pedromassangocode

    Hi @matejdro
    Can you please provide your flutter doctor -v and your pubspec.yaml?
    Thank you

  2. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Mar 18, 2021
  3. matejdro commented on Mar 18, 2021

    @matejdro
    Author

    Flutter doctor:

    [✓] Flutter (Channel stable, 2.0.1, on Linux, locale en_GB.UTF-8)
        • Flutter version 2.0.1 at /opt/flutter
        • Framework revision c5a4b4029c (2 weeks ago), 2021-03-04 09:47:48 -0800
        • Engine revision 40441def69
        • Dart version 2.12.0
    
    [!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
        • Android SDK at /home/matej/Android/Sdk
        • Platform android-30, build-tools 30.0.3
        • Java binary at: /usr/lib/jvm/default/bin/java
        • Java version openjdk version "15.0.2" 2021-01-19
        ✗ Android license status unknown.
          Run `flutter doctor --android-licenses` to accept the SDK licenses.
          See https://flutter.dev/docs/get-started/install/linux#android-setup for more details.
    
    [✗] Chrome - develop for the web (Cannot find Chrome executable at google-chrome)
        ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
    
    [!] Android Studio (not installed)
        • Android Studio not found; download from https://developer.android.com/studio/index.html
          (or visit https://flutter.dev/docs/get-started/install/linux#android-setup for detailed instructions).
    
    [✓] IntelliJ IDEA Ultimate Edition (version 2020.3)
        • IntelliJ at /home/matej/.local/share/JetBrains/Toolbox/apps/IDEA-U/ch-0/203.6682.168
        • Flutter plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/9212-flutter
        • Dart plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/6351-dart
    
    [✓] Connected device (1 available)
        • GM1913 (mobile) • a6734f0a • android-arm64 • Android 10 (API 29)
    

    pubspec: https://github.com/pebble-dev/mobile-app/blob/67279682a1b588f706dd855ee75019609ec49304/pubspec.yaml

  4. removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Mar 18, 2021
  5. pedromassangocode commented on Mar 22, 2021

    @pedromassangocode

    I can reproduce this on the latest version of the pigeon package: pigeon: ^0.1.23.

  6. added
    has reproducible stepsThe issue has been confirmed reproducible and is ready to work on
    packageflutter/packages repository. See also p: labels.
    p: pigeonrelated to pigeon messaging codegen tool
    and removed
    in triagePresently being triaged by the triage team
    on Mar 22, 2021
  7. github-actions commented on Aug 3, 2021

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  8. locked as resolved and limited conversation to collaborators on Aug 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    found in release: 2.0Found to occur in 2.0has reproducible stepsThe issue has been confirmed reproducible and is ready to work onp: pigeonrelated to pigeon messaging codegen toolpackageflutter/packages repository. See also p: labels.r: fixedIssue is closed as already fixed in a newer version

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions