Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix newly added strict_top_level_inference everywhere #1467

Merged
merged 1 commit into from
Jan 2, 2025
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class GeneralTestClass1 {
late DateTime dateOfBirth;
dynamic dynamicType;

//ignore: prefer_typing_uninitialized_variables,type_annotate_public_apis,inference_failure_on_uninitialized_variable
//ignore: prefer_typing_uninitialized_variables,type_annotate_public_apis,inference_failure_on_uninitialized_variable, strict_top_level_inference
var varType;
late List<int> listOfInts;
}
Expand Down
2 changes: 2 additions & 0 deletions json_serializable/test/src/to_from_json_test_input.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

// @dart=3.6

// ignore_for_file: strict_top_level_inference

part of '_json_serializable_test_input.dart';

int _toInt(bool input) => 42;
Expand Down
2 changes: 1 addition & 1 deletion json_serializable/test/test_sources/test_sources.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class FromJsonOptionalParameters {
}

class ChildWithFromJson {
//ignore: avoid_unused_constructor_parameters
//ignore: avoid_unused_constructor_parameters, strict_top_level_inference
ChildWithFromJson.fromJson(json, {initValue = false});
}

Expand Down
2 changes: 1 addition & 1 deletion json_serializable/tool/field_matrix_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import 'package:source_helper/source_helper.dart';

import 'shared.dart';

Builder builder([_]) => _FieldMatrixBuilder();
Builder builder([BuilderOptions? _]) => _FieldMatrixBuilder();

class _FieldMatrixBuilder extends Builder {
@override
Expand Down
2 changes: 1 addition & 1 deletion json_serializable/tool/readme_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import 'package:yaml/yaml.dart';
import 'test_type_builder.dart';
import 'test_type_data.dart';

Builder readmeBuilder([_]) => _ReadmeBuilder();
Builder readmeBuilder([BuilderOptions? _]) => _ReadmeBuilder();

class _ReadmeBuilder extends Builder {
@override
Expand Down
3 changes: 2 additions & 1 deletion json_serializable/tool/test_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import 'package:path/path.dart' as p;

import 'shared.dart';

Builder testBuilder([_]) => validate('_test_builder', const _TestBuilder());
Builder testBuilder([BuilderOptions? _]) =>
validate('_test_builder', const _TestBuilder());

class _TestBuilder implements Builder {
const _TestBuilder();
Expand Down
5 changes: 3 additions & 2 deletions json_serializable/tool/test_type_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ final _iterableGenericArgs = ([
const _defaultCollectionExpressions = '42, true, false, null';
const _altCollectionExpressions = '43, false';

Builder typeBuilder([_]) => validate('_type_builder', const _TypeBuilder());
Builder typeBuilder([BuilderOptions? _]) =>
validate('_type_builder', const _TypeBuilder());

class _TypeBuilder implements Builder {
const _TypeBuilder();
Expand Down Expand Up @@ -147,7 +148,7 @@ class _TypeBuilder implements Builder {
{'.dart': _allTypes.keys.map(toTypeExtension).toSet().toList()..sort()};
}

Builder typeTestBuilder([_]) =>
Builder typeTestBuilder([BuilderOptions? _]) =>
validate('_type_test_builder', const _TypeTestBuilder());

class _TypeTestBuilder implements Builder {
Expand Down
Loading