-
Notifications
You must be signed in to change notification settings - Fork 190
Closed
Labels
Description
I am trying to update dwds's data types to null safety (dart-lang/webdev#1615), but getting the new analyzer warnings on the generated code:
Analysis warnings on generated code in dwds
➜ dwds git:(annagrin/null-safe-data-types) ✗ dart analyze .
Analyzing .... 2.9s
info • lib/data/serializers.g.dart:28:11 • Don't create a lambda when a tear-off will do. •
unnecessary_lambdas
info • lib/data/serializers.g.dart:31:11 • Don't create a lambda when a tear-off will do. •
unnecessary_lambdas
2 issues found.
Original code
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'package:built_collection/built_collection.dart';
import 'package:built_value/serializer.dart';
import 'build_result.dart';
import 'connect_request.dart';
import 'debug_event.dart';
import 'devtools_request.dart';
import 'error_response.dart';
import 'extension_request.dart';
import 'isolate_events.dart';
import 'register_event.dart';
import 'run_request.dart';
part 'serializers.g.dart';
/// Serializers for all the types used in DWDS communication.
@SerializersFor([
BatchedEvents,
BatchedDebugEvents,
BuildResult,
ConnectRequest,
DebugEvent,
DevToolsRequest,
DevToolsResponse,
IsolateExit,
IsolateStart,
ExtensionRequest,
ExtensionResponse,
ExtensionEvent,
ErrorResponse,
RegisterEvent,
RunRequest,
])
final Serializers serializers = _$serializers;
Generated code
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'serializers.dart';
// **************************************************************************
// BuiltValueGenerator
// **************************************************************************
Serializers _$serializers = (new Serializers().toBuilder()
..add(BatchedDebugEvents.serializer)
..add(BatchedEvents.serializer)
..add(BuildResult.serializer)
..add(BuildStatus.serializer)
..add(ConnectRequest.serializer)
..add(DebugEvent.serializer)
..add(DevToolsRequest.serializer)
..add(DevToolsResponse.serializer)
..add(ErrorResponse.serializer)
..add(ExtensionEvent.serializer)
..add(ExtensionRequest.serializer)
..add(ExtensionResponse.serializer)
..add(IsolateExit.serializer)
..add(IsolateStart.serializer)
..add(RegisterEvent.serializer)
..add(RunRequest.serializer)
..addBuilderFactory(
const FullType(BuiltList, const [const FullType(DebugEvent)]),
() => new ListBuilder<DebugEvent>())
..addBuilderFactory(
const FullType(BuiltList, const [const FullType(ExtensionEvent)]),
() => new ListBuilder<ExtensionEvent>()))
.build();
// ignore_for_file: always_put_control_body_on_new_line,always_specify_types,annotate_overrides,avoid_annotating_with_dynamic,avoid_as,avoid_catches_without_on_clauses,avoid_returning_this,deprecated_member_use_from_same_package,lines_longer_than_80_chars,no_leading_underscores_for_local_identifiers,omit_local_variable_types,prefer_expression_function_bodies,sort_constructors_first,test_types_in_equals,unnecessary_const,unnecessary_new