Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/pigeon/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## 13.1.2

* Adds compatibilty with `analyzer` 6.x.
* [cpp] Fix C++ generator skipping FlutterError if no FlutterAPI is defined.
Copy link
Contributor

Choose a reason for hiding this comment

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

This will need to be it's own version bump. With associated changes required (changelog, pubspec, and generator_tools)


## 13.1.1

Expand Down
7 changes: 6 additions & 1 deletion packages/pigeon/lib/cpp_generator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,14 @@ class CppHeaderGenerator extends StructuredGenerator<CppOptions> {
final bool hasFlutterApi = root.apis.any((Api api) =>
api.methods.isNotEmpty && api.location == ApiLocation.flutter);

if (hasHostApi) {
// Always write?
if (hasFlutterApi || hasHostApi) {
Copy link
Contributor

Choose a reason for hiding this comment

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

the conditional isn't needed here. Just put _writeErrorOr above the pre-existing conditionals.

_writeErrorOr(indent, friends: root.apis.map((Api api) => api.name));
}

if (hasHostApi) {
// Nothing yet
}
if (hasFlutterApi) {
// Nothing yet.
}
Expand Down