Skip to content

Commit c50d9e0

Browse files
stuartmorgan-gnploi
authored andcommitted
[pigeon] Minor updates for pana (flutter#3397)
- Removes the Flutter SDK constraint; as far as I remember and can tell from git history, we only did this to prevent pigeon from running tests on unsupported versions before the repo tooling supported minimum Dart versions. - Removes an unnecessary null check. We intentionally have that analysis option off for the repo as long as Flutter supports non-strong-mode code, but the specific check here isn't subject to client code so isn't useful to keep. Part (maybe all?) of flutter/flutter#122029
1 parent 241fb84 commit c50d9e0

File tree

22 files changed

+37
-38
lines changed

22 files changed

+37
-38
lines changed

packages/pigeon/CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
## NEXT
1+
## 9.0.5
22

3+
* Removes the unnecessary Flutter constraint.
4+
* Removes an unnecessary null check.
35
* Aligns Dart and Flutter SDK constraints.
46

57
## 9.0.4

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.0.4';
14+
const String pigeonVersion = '9.0.5';
1515

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

packages/pigeon/lib/pigeon_lib.dart

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -672,22 +672,20 @@ List<Error> _validateAst(Root root, String source) {
672672
final Iterable<String> customEnums = root.enums.map((Enum x) => x.name);
673673
for (final Class klass in root.classes) {
674674
for (final NamedType field in getFieldsInSerializationOrder(klass)) {
675-
if (field.type.typeArguments != null) {
676-
for (final TypeDeclaration typeArgument in field.type.typeArguments) {
677-
if (!typeArgument.isNullable) {
678-
result.add(Error(
679-
message:
680-
'Generic type arguments must be nullable in field "${field.name}" in class "${klass.name}".',
681-
lineNumber: _calculateLineNumberNullable(source, field.offset),
682-
));
683-
}
684-
if (customEnums.contains(typeArgument.baseName)) {
685-
result.add(Error(
686-
message:
687-
'Enum types aren\'t supported in type arguments in "${field.name}" in class "${klass.name}".',
688-
lineNumber: _calculateLineNumberNullable(source, field.offset),
689-
));
690-
}
675+
for (final TypeDeclaration typeArgument in field.type.typeArguments) {
676+
if (!typeArgument.isNullable) {
677+
result.add(Error(
678+
message:
679+
'Generic type arguments must be nullable in field "${field.name}" in class "${klass.name}".',
680+
lineNumber: _calculateLineNumberNullable(source, field.offset),
681+
));
682+
}
683+
if (customEnums.contains(typeArgument.baseName)) {
684+
result.add(Error(
685+
message:
686+
'Enum types aren\'t supported in type arguments in "${field.name}" in class "${klass.name}".',
687+
lineNumber: _calculateLineNumberNullable(source, field.offset),
688+
));
691689
}
692690
}
693691
if (!(validTypes.contains(field.type.baseName) ||

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.0.4), do not edit directly.
5+
// Autogenerated from Pigeon (v9.0.5), 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.0.4), do not edit directly.
5+
// Autogenerated from Pigeon (v9.0.5), 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.0.4), do not edit directly.
5+
// Autogenerated from Pigeon (v9.0.5), 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.0.4), do not edit directly.
5+
// Autogenerated from Pigeon (v9.0.5), 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 (v9.0.4), do not edit directly.
5+
// Autogenerated from Pigeon (v9.0.5), 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 (v9.0.4), do not edit directly.
5+
// Autogenerated from Pigeon (v9.0.5), 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.0.4), do not edit directly.
5+
// Autogenerated from Pigeon (v9.0.5), 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)