Skip to content

Commit 14fc7a8

Browse files
[pigeon] Fix missed casting of not nullable Dart int to Kotlin long (#3004)
* [pigeon] Fix missed casting of not nullable Dart int to Kotlin long * [pigeon] Consolidate simple datatypes header unit tests * Release fixed integration tests of Android Kotlin implementation * Add gen files * Update formatting By executing: dart pub global run flutter_plugin_tools format --packages pigeon * remove merge conflict code Co-authored-by: Tarrin Neal <tarrinneal@gmail.com>
1 parent e61771c commit 14fc7a8

File tree

24 files changed

+119
-45
lines changed

24 files changed

+119
-45
lines changed

packages/pigeon/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 7.0.2
2+
3+
* [kotlin] Fixes a missed casting of not nullable Dart 'int' to Kotlin 64bit long.
4+
15
## 7.0.1
26

37
* [generator_tools] adds `newln` method for adding empty lines and ending lines.

packages/pigeon/lib/generator_tools.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import 'dart:mirrors';
99
import 'ast.dart';
1010

1111
/// The current version of pigeon. This must match the version in pubspec.yaml.
12-
const String pigeonVersion = '7.0.1';
12+
const String pigeonVersion = '7.0.2';
1313

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

packages/pigeon/lib/kotlin_generator.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,10 @@ class KotlinGenerator extends StructuredGenerator<KotlinOptions> {
255255
customEnumNames.contains(field.type.baseName)) {
256256
indent.writeln(
257257
'val ${field.name} = $fieldType.ofRaw($listValue as Int)!!');
258+
} else if (isInt) {
259+
indent.write('val ${field.name} = $listValue');
260+
indent
261+
.addln('.let { if (it is Int) it.toLong() else it as Long }');
258262
} else {
259263
indent.writeln('val ${field.name} = $listValue as $fieldType');
260264
}

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 (v7.0.1), do not edit directly.
5+
// Autogenerated from Pigeon (v7.0.2), 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 (v7.0.1), do not edit directly.
5+
// Autogenerated from Pigeon (v7.0.2), 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 (v7.0.1), do not edit directly.
5+
// Autogenerated from Pigeon (v7.0.2), 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 (v7.0.1), do not edit directly.
5+
// Autogenerated from Pigeon (v7.0.2), 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: 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 (v7.0.1), do not edit directly.
5+
// Autogenerated from Pigeon (v7.0.2), do not edit directly.
66
// See also: https://pub.dev/packages/pigeon
77

88
#import "CoreTests.gen.h"

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 (v7.0.1), do not edit directly.
5+
// Autogenerated from Pigeon (v7.0.2), 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 (v7.0.1), do not edit directly.
5+
// Autogenerated from Pigeon (v7.0.2), 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

0 commit comments

Comments
 (0)