Skip to content

[pigeon] display "common" Dart syntax issues before crashing #58897

Open

Description

@xster

for instance

@FlutterApi()
abstract class Api {
  foo();
}

is invalid because there's no return type. But the error message from running pigeon is

Unhandled exception:
type '_SpecialTypeMirror' is not a subtype of type 'ClassMirror'
#0      Pigeon.parse (package:pigeon/pigeon_lib.dart:179:37)
#1      Pigeon.run (package:pigeon/pigeon_lib.dart:340:48)
#2      main (file:///Users/xster/development/samples/add_to_app/flutter_module_books/_pigeon_temp_.dart:7:21)
#3      _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:299:32)
#4      _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12)

pub finished with exit code 255

Wonder if there's a way to attach our own analysis_options.yaml for basic Dart linting.

cc @gaaclarke

Activity

  1. added
    packageflutter/packages repository. See also p: labels.
    on Jun 7, 2020
  2. stuartmorgan-g commented on Oct 26, 2021

    @stuartmorgan-g
    Contributor

    Was this fixed with the move away from mirrors?

  3. added
    P2Important issues not at the top of the work list
    on Oct 26, 2021
  4. gaaclarke commented on Oct 26, 2021

    @gaaclarke
    Member

    Was this fixed with the move away from mirrors?

    It may for some cases. The example that was provided is not actually an error in Dart since not defining a return value can be valid and default to dynamic. We get a null pointer exception when trying to get the return type. We could have a better error for that.

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

    P2Important issues not at the top of the work listp: pigeonrelated to pigeon messaging codegen toolpackageflutter/packages repository. See also p: labels.team-ecosystemOwned by Ecosystem teamtriaged-ecosystemTriaged by Ecosystem team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions