Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[pigeon] fixed cast error that can happen with FlutterApi and primitive lists#506

Merged
gaaclarke merged 1 commit intoflutter:masterfrom
gaaclarke:pigeon-flutter-list-cast
Nov 4, 2021
Merged

[pigeon] fixed cast error that can happen with FlutterApi and primitive lists#506
gaaclarke merged 1 commit intoflutter:masterfrom
gaaclarke:pigeon-flutter-list-cast

Conversation

@gaaclarke
Copy link
Member

@gaaclarke gaaclarke commented Nov 3, 2021

fixes: flutter/flutter#93012

Pre-launch Checklist

  • The title of the PR starts with the name of the package surrounded by square brackets, e.g. [shared_preferences]
  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide.
  • I listed at least one issue that this PR fixes in the description above.
  • I added new tests to check the change I am making or feature I am adding, or Hixie said the PR is test-exempt.
  • I updated pubspec.yaml with an appropriate new version according to the pub versioning philosophy.
  • I updated CHANGELOG.md to add a description of the change.
  • I updated/added relevant documentation (doc comments with ///).
  • I signed the CLA.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@google-cla google-cla bot added the cla: yes label Nov 3, 2021
@gaaclarke gaaclarke force-pushed the pigeon-flutter-list-cast branch 4 times, most recently from 20c1f90 to e23b509 Compare November 3, 2021 23:52
@gaaclarke gaaclarke force-pushed the pigeon-flutter-list-cast branch from e23b509 to f1debe4 Compare November 3, 2021 23:55
@gaaclarke gaaclarke marked this pull request as ready for review November 4, 2021 00:27
Copy link
Collaborator

@stuartmorgan-g stuartmorgan-g left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM modulo the question about the binary messenger.

}
indent.write('static void setup(${api.name}$nullTag api) ');
indent.write(
'static void setup(${api.name}$nullTag api, {BinaryMessenger$nullTag binaryMessenger}) ');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Off-topic, but the change here reminded me that I wanted to raise this: could we fix the fact that this name is wrong (it should be a verb, setUp) in all of the generators? If we don't want a breaking change we could have setup as a deprecated passthrough that calls setUp.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea that sounds reasonable, we have talked about this in the past. I filed an issue for it: flutter/flutter#93062

}
indent.write('static void setup(${api.name}$nullTag api) ');
indent.write(
'static void setup(${api.name}$nullTag api, {BinaryMessenger$nullTag binaryMessenger}) ');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the addition of binaryMessenger related to this fix?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was required for the test for the fix. I think we were relying on compilation / text-output unit tests for FlutterApi generation a lot and didn't have existing runtime tests for the Dart code generated from FlutterApi. Less people use FlutterApi too so it probably went unnoticed because of that.

@gaaclarke gaaclarke merged commit f536388 into flutter:master Nov 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FlutterApi cast exception for generic classes

2 participants