Skip to content

Commit 4914c64

Browse files
[pigeon] Fix Obj-C signature mismatch (#3657)
[pigeon] Fix Obj-C signature mismatch
1 parent 7b78d15 commit 4914c64

File tree

23 files changed

+36
-27
lines changed

23 files changed

+36
-27
lines changed

packages/pigeon/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 9.2.4
2+
3+
* [objc] Fixes a warning due to a C++-style function signature in the codec
4+
getter's definition.
5+
16
## 9.2.3
27

38
* [java] Fixes `UnknownNullability` and `SyntheticAccessor` warnings.

packages/pigeon/lib/generator_tools.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import 'ast.dart';
1111
/// The current version of pigeon.
1212
///
1313
/// This must match the version in pubspec.yaml.
14-
const String pigeonVersion = '9.2.3';
14+
const String pigeonVersion = '9.2.4';
1515

1616
/// Read all the content from [stdin] to a String.
1717
String readStdin() {

packages/pigeon/lib/objc_generator.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -707,7 +707,7 @@ static id GetNullableObjectAtIndex(NSArray *array, NSInteger key) {
707707
/// ...
708708
/// @interface FooHostApiCodecReaderWriter : FlutterStandardReaderWriter
709709
/// ...
710-
/// NSObject<FlutterMessageCodec> *FooHostApiCodecGetCodec() {...}
710+
/// NSObject<FlutterMessageCodec> *FooHostApiCodecGetCodec(void) {...}
711711
void _writeCodec(
712712
Indent indent, String name, ObjcOptions options, Api api, Root root) {
713713
assert(getCodecClasses(api, root).isNotEmpty);
@@ -779,7 +779,7 @@ static id GetNullableObjectAtIndex(NSArray *array, NSInteger key) {
779779
final String readerWriterName = '${name}ReaderWriter';
780780

781781
indent.write(
782-
'NSObject<FlutterMessageCodec> *${_getCodecGetterName(options.prefix, api.name)}() ');
782+
'NSObject<FlutterMessageCodec> *${_getCodecGetterName(options.prefix, api.name)}(void) ');
783783
indent.addScoped('{', '}', () {
784784
indent
785785
.writeln('static FlutterStandardMessageCodec *sSharedObject = nil;');

packages/pigeon/mock_handler_tester/test/message.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44
//
5-
// Autogenerated from Pigeon (v9.2.3), do not edit directly.
5+
// Autogenerated from Pigeon (v9.2.4), do not edit directly.
66
// See also: https://pub.dev/packages/pigeon
77
// ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import, unnecessary_parenthesis, prefer_null_aware_operators, omit_local_variable_types, unused_shown_name, unnecessary_import
88

packages/pigeon/mock_handler_tester/test/test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44
//
5-
// Autogenerated from Pigeon (v9.2.3), do not edit directly.
5+
// Autogenerated from Pigeon (v9.2.4), do not edit directly.
66
// See also: https://pub.dev/packages/pigeon
77
// ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import, unnecessary_parenthesis, unnecessary_import
88
// ignore_for_file: avoid_relative_lib_imports

packages/pigeon/platform_tests/alternate_language_test_plugin/android/src/main/java/com/example/alternate_language_test_plugin/CoreTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44
//
5-
// Autogenerated from Pigeon (v9.2.3), do not edit directly.
5+
// Autogenerated from Pigeon (v9.2.4), do not edit directly.
66
// See also: https://pub.dev/packages/pigeon
77

88
package com.example.alternate_language_test_plugin;

packages/pigeon/platform_tests/alternate_language_test_plugin/ios/Classes/CoreTests.gen.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44
//
5-
// Autogenerated from Pigeon (v9.2.3), do not edit directly.
5+
// Autogenerated from Pigeon (v9.2.4), do not edit directly.
66
// See also: https://pub.dev/packages/pigeon
77

88
#import <Foundation/Foundation.h>

packages/pigeon/platform_tests/alternate_language_test_plugin/ios/Classes/CoreTests.gen.m

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44
//
5-
// Autogenerated from Pigeon (v9.2.3), do not edit directly.
5+
// Autogenerated from Pigeon (v9.2.4), do not edit directly.
66
// See also: https://pub.dev/packages/pigeon
77

88
#import "CoreTests.gen.h"
@@ -298,7 +298,7 @@ - (FlutterStandardReader *)readerWithData:(NSData *)data {
298298
}
299299
@end
300300

301-
NSObject<FlutterMessageCodec> *HostIntegrationCoreApiGetCodec() {
301+
NSObject<FlutterMessageCodec> *HostIntegrationCoreApiGetCodec(void) {
302302
static FlutterStandardMessageCodec *sSharedObject = nil;
303303
static dispatch_once_t sPred = 0;
304304
dispatch_once(&sPred, ^{
@@ -1838,7 +1838,7 @@ - (FlutterStandardReader *)readerWithData:(NSData *)data {
18381838
}
18391839
@end
18401840

1841-
NSObject<FlutterMessageCodec> *FlutterIntegrationCoreApiGetCodec() {
1841+
NSObject<FlutterMessageCodec> *FlutterIntegrationCoreApiGetCodec(void) {
18421842
static FlutterStandardMessageCodec *sSharedObject = nil;
18431843
static dispatch_once_t sPred = 0;
18441844
dispatch_once(&sPred, ^{
@@ -2133,7 +2133,7 @@ - (void)echoAsyncString:(NSString *)arg_aString
21332133
}
21342134
@end
21352135

2136-
NSObject<FlutterMessageCodec> *HostTrivialApiGetCodec() {
2136+
NSObject<FlutterMessageCodec> *HostTrivialApiGetCodec(void) {
21372137
static FlutterStandardMessageCodec *sSharedObject = nil;
21382138
sSharedObject = [FlutterStandardMessageCodec sharedInstance];
21392139
return sSharedObject;
@@ -2159,7 +2159,7 @@ void HostTrivialApiSetup(id<FlutterBinaryMessenger> binaryMessenger,
21592159
}
21602160
}
21612161
}
2162-
NSObject<FlutterMessageCodec> *HostSmallApiGetCodec() {
2162+
NSObject<FlutterMessageCodec> *HostSmallApiGetCodec(void) {
21632163
static FlutterStandardMessageCodec *sSharedObject = nil;
21642164
sSharedObject = [FlutterStandardMessageCodec sharedInstance];
21652165
return sSharedObject;
@@ -2242,7 +2242,7 @@ - (FlutterStandardReader *)readerWithData:(NSData *)data {
22422242
}
22432243
@end
22442244

2245-
NSObject<FlutterMessageCodec> *FlutterSmallApiGetCodec() {
2245+
NSObject<FlutterMessageCodec> *FlutterSmallApiGetCodec(void) {
22462246
static FlutterStandardMessageCodec *sSharedObject = nil;
22472247
static dispatch_once_t sPred = 0;
22482248
dispatch_once(&sPred, ^{

packages/pigeon/platform_tests/flutter_null_safe_unit_tests/lib/core_tests.gen.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44
//
5-
// Autogenerated from Pigeon (v9.2.3), do not edit directly.
5+
// Autogenerated from Pigeon (v9.2.4), do not edit directly.
66
// See also: https://pub.dev/packages/pigeon
77
// ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import, unnecessary_parenthesis, prefer_null_aware_operators, omit_local_variable_types, unused_shown_name, unnecessary_import
88

packages/pigeon/platform_tests/flutter_null_safe_unit_tests/lib/flutter_unittests.gen.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44
//
5-
// Autogenerated from Pigeon (v9.2.3), do not edit directly.
5+
// Autogenerated from Pigeon (v9.2.4), do not edit directly.
66
// See also: https://pub.dev/packages/pigeon
77
// ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import, unnecessary_parenthesis, prefer_null_aware_operators, omit_local_variable_types, unused_shown_name, unnecessary_import
88

packages/pigeon/platform_tests/flutter_null_safe_unit_tests/lib/multiple_arity.gen.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44
//
5-
// Autogenerated from Pigeon (v9.2.3), do not edit directly.
5+
// Autogenerated from Pigeon (v9.2.4), do not edit directly.
66
// See also: https://pub.dev/packages/pigeon
77
// ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import, unnecessary_parenthesis, prefer_null_aware_operators, omit_local_variable_types, unused_shown_name, unnecessary_import
88

packages/pigeon/platform_tests/flutter_null_safe_unit_tests/lib/non_null_fields.gen.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44
//
5-
// Autogenerated from Pigeon (v9.2.3), do not edit directly.
5+
// Autogenerated from Pigeon (v9.2.4), do not edit directly.
66
// See also: https://pub.dev/packages/pigeon
77
// ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import, unnecessary_parenthesis, prefer_null_aware_operators, omit_local_variable_types, unused_shown_name, unnecessary_import
88

packages/pigeon/platform_tests/flutter_null_safe_unit_tests/lib/null_fields.gen.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44
//
5-
// Autogenerated from Pigeon (v9.2.3), do not edit directly.
5+
// Autogenerated from Pigeon (v9.2.4), do not edit directly.
66
// See also: https://pub.dev/packages/pigeon
77
// ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import, unnecessary_parenthesis, prefer_null_aware_operators, omit_local_variable_types, unused_shown_name, unnecessary_import
88

packages/pigeon/platform_tests/flutter_null_safe_unit_tests/lib/nullable_returns.gen.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44
//
5-
// Autogenerated from Pigeon (v9.2.3), do not edit directly.
5+
// Autogenerated from Pigeon (v9.2.4), do not edit directly.
66
// See also: https://pub.dev/packages/pigeon
77
// ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import, unnecessary_parenthesis, prefer_null_aware_operators, omit_local_variable_types, unused_shown_name, unnecessary_import
88

packages/pigeon/platform_tests/flutter_null_safe_unit_tests/lib/primitive.gen.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44
//
5-
// Autogenerated from Pigeon (v9.2.3), do not edit directly.
5+
// Autogenerated from Pigeon (v9.2.4), do not edit directly.
66
// See also: https://pub.dev/packages/pigeon
77
// ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import, unnecessary_parenthesis, prefer_null_aware_operators, omit_local_variable_types, unused_shown_name, unnecessary_import
88

packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/core_tests.gen.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44
//
5-
// Autogenerated from Pigeon (v9.2.3), do not edit directly.
5+
// Autogenerated from Pigeon (v9.2.4), do not edit directly.
66
// See also: https://pub.dev/packages/pigeon
77
// ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import, unnecessary_parenthesis, prefer_null_aware_operators, omit_local_variable_types, unused_shown_name, unnecessary_import
88

packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/CoreTests.gen.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44
//
5-
// Autogenerated from Pigeon (v9.2.3), do not edit directly.
5+
// Autogenerated from Pigeon (v9.2.4), do not edit directly.
66
// See also: https://pub.dev/packages/pigeon
77

88
package com.example.test_plugin

packages/pigeon/platform_tests/test_plugin/ios/Classes/CoreTests.gen.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44
//
5-
// Autogenerated from Pigeon (v9.2.3), do not edit directly.
5+
// Autogenerated from Pigeon (v9.2.4), do not edit directly.
66
// See also: https://pub.dev/packages/pigeon
77

88
import Foundation

packages/pigeon/platform_tests/test_plugin/macos/Classes/CoreTests.gen.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44
//
5-
// Autogenerated from Pigeon (v9.2.3), do not edit directly.
5+
// Autogenerated from Pigeon (v9.2.4), do not edit directly.
66
// See also: https://pub.dev/packages/pigeon
77

88
import Foundation

packages/pigeon/platform_tests/test_plugin/windows/pigeon/core_tests.gen.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44
//
5-
// Autogenerated from Pigeon (v9.2.3), do not edit directly.
5+
// Autogenerated from Pigeon (v9.2.4), do not edit directly.
66
// See also: https://pub.dev/packages/pigeon
77

88
#undef _HAS_EXCEPTIONS

packages/pigeon/platform_tests/test_plugin/windows/pigeon/core_tests.gen.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44
//
5-
// Autogenerated from Pigeon (v9.2.3), do not edit directly.
5+
// Autogenerated from Pigeon (v9.2.4), do not edit directly.
66
// See also: https://pub.dev/packages/pigeon
77

88
#ifndef PIGEON_CORE_TESTS_GEN_H_

packages/pigeon/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: pigeon
22
description: Code generator tool to make communication between Flutter and the host platform type-safe and easier.
33
repository: https://github.com/flutter/packages/tree/main/packages/pigeon
44
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3Apigeon
5-
version: 9.2.3 # This must match the version in lib/generator_tools.dart
5+
version: 9.2.4 # This must match the version in lib/generator_tools.dart
66

77
environment:
88
sdk: ">=2.18.0 <4.0.0"

packages/pigeon/test/objc_generator_test.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,7 @@ void main() {
300300
expect(code, contains('/// @return `nil` only when `error != nil`.'));
301301
expect(code, matches('nullable Output.*doSomething.*Input.*FlutterError'));
302302
expect(code, matches('ApiSetup.*<Api>.*_Nullable'));
303+
expect(code, contains('ApiGetCodec(void)'));
303304
});
304305

305306
test('gen one api source', () {
@@ -347,6 +348,7 @@ void main() {
347348
code,
348349
contains(
349350
'NSCAssert([api respondsToSelector:@selector(doSomething:error:)'));
351+
expect(code, contains('ApiGetCodec(void) {'));
350352
});
351353

352354
test('all the simple datatypes header', () {
@@ -654,6 +656,7 @@ void main() {
654656
contains(
655657
'initWithBinaryMessenger:(id<FlutterBinaryMessenger>)binaryMessenger;'));
656658
expect(code, matches('void.*doSomething.*Input.*Output'));
659+
expect(code, contains('ApiGetCodec(void)'));
657660
});
658661

659662
test('gen flutter api source', () {
@@ -695,6 +698,7 @@ void main() {
695698
final String code = sink.toString();
696699
expect(code, contains('@implementation Api'));
697700
expect(code, matches('void.*doSomething.*Input.*Output.*{'));
701+
expect(code, contains('ApiGetCodec(void) {'));
698702
});
699703

700704
test('gen host void header', () {

0 commit comments

Comments
 (0)