From 1e4a974a5d0077f25f0df76228eeccf62ef035ca Mon Sep 17 00:00:00 2001 From: Brian Wilkerson Date: Fri, 9 Dec 2022 22:54:08 +0000 Subject: [PATCH] Remove some unnecessary ignore comments in compiler Change-Id: I323c846776637b91922abac73acc2eac6017d4de Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274722 Reviewed-by: Sigmund Cherem Commit-Queue: Brian Wilkerson --- pkg/compiler/lib/src/io/position_information.dart | 2 -- pkg/compiler/lib/src/ssa/interceptor_simplifier.dart | 5 +---- pkg/compiler/lib/src/ssa/value_range_analyzer.dart | 7 ------- pkg/compiler/test/codegen/string_reference_test.dart | 2 -- .../test/deferred/load_graph_segmentation_test.dart | 1 - 5 files changed, 1 insertion(+), 16 deletions(-) diff --git a/pkg/compiler/lib/src/io/position_information.dart b/pkg/compiler/lib/src/io/position_information.dart index dc628b40517..1697ad2b0b8 100644 --- a/pkg/compiler/lib/src/io/position_information.dart +++ b/pkg/compiler/lib/src/io/position_information.dart @@ -169,7 +169,6 @@ class CodePosition { CodePosition(this.startPosition, this.endPosition, this.closingPosition); - // ignore: MISSING_RETURN int? getPosition(CodePositionKind kind) { switch (kind) { case CodePositionKind.START: @@ -246,7 +245,6 @@ enum SourcePositionKind { INNER, } -// ignore: MISSING_RETURN SourceLocation? getSourceLocation(SourceInformation sourceInformation, [SourcePositionKind sourcePositionKind = SourcePositionKind.START]) { assert((sourceInformation as dynamic) != null); diff --git a/pkg/compiler/lib/src/ssa/interceptor_simplifier.dart b/pkg/compiler/lib/src/ssa/interceptor_simplifier.dart index 7fa08a0c3b3..217d00779d5 100644 --- a/pkg/compiler/lib/src/ssa/interceptor_simplifier.dart +++ b/pkg/compiler/lib/src/ssa/interceptor_simplifier.dart @@ -82,10 +82,7 @@ class SsaSimplifyInterceptors extends HBaseVisitor // possible that all uses can be rewritten to use different constants. HInstruction? constant = tryComputeConstantInterceptor( - // ignore: avoid_dynamic_calls - invoke.inputs[1], - // ignore: avoid_dynamic_calls - interceptor.interceptedClasses); + invoke.inputs[1], interceptor.interceptedClasses); if (constant != null) { invoke.changeUse(interceptor, constant); } diff --git a/pkg/compiler/lib/src/ssa/value_range_analyzer.dart b/pkg/compiler/lib/src/ssa/value_range_analyzer.dart index 62cc63ad73f..3760651c89b 100644 --- a/pkg/compiler/lib/src/ssa/value_range_analyzer.dart +++ b/pkg/compiler/lib/src/ssa/value_range_analyzer.dart @@ -203,7 +203,6 @@ class IntValue extends Value { @override bool operator ==(other) { if (other is! IntValue) return false; - // ignore: avoid_dynamic_calls return this.value == other.value; } @@ -294,7 +293,6 @@ class InstructionValue extends Value { @override bool operator ==(other) { if (other is! InstructionValue) return false; - // ignore: avoid_dynamic_calls return this.instruction == other.instruction; } @@ -367,9 +365,7 @@ class AddValue extends BinaryOperationValue { @override bool operator ==(other) { if (other is! AddValue) return false; - // ignore: avoid_dynamic_calls return (left == other.left && right == other.right) || - // ignore: avoid_dynamic_calls (left == other.right && right == other.left); } @@ -425,7 +421,6 @@ class SubtractValue extends BinaryOperationValue { @override bool operator ==(other) { if (other is! SubtractValue) return false; - // ignore: avoid_dynamic_calls return left == other.left && right == other.right; } @@ -482,7 +477,6 @@ class NegateValue extends Value { @override bool operator ==(other) { if (other is! NegateValue) return false; - // ignore: avoid_dynamic_calls return value == other.value; } @@ -631,7 +625,6 @@ class Range { @override bool operator ==(other) { if (other is! Range) return false; - // ignore: avoid_dynamic_calls return other.lower == lower && other.upper == upper; } diff --git a/pkg/compiler/test/codegen/string_reference_test.dart b/pkg/compiler/test/codegen/string_reference_test.dart index 31724f1045e..029998b9808 100644 --- a/pkg/compiler/test/codegen/string_reference_test.dart +++ b/pkg/compiler/test/codegen/string_reference_test.dart @@ -30,8 +30,6 @@ void test(List strings, String expected, {bool minified = false}) { } extension on List { - // TODO(42122): Remove when analyzer doesn't think `*` is unused. - // ignore: unused_element List operator *(int count) { return List.filled(count, this).expand((list) => list).toList(); } diff --git a/pkg/compiler/test/deferred/load_graph_segmentation_test.dart b/pkg/compiler/test/deferred/load_graph_segmentation_test.dart index 3bd211ea4a5..f26a03e8984 100644 --- a/pkg/compiler/test/deferred/load_graph_segmentation_test.dart +++ b/pkg/compiler/test/deferred/load_graph_segmentation_test.dart @@ -42,7 +42,6 @@ void main() { var mainOutputUnit = closedWorld.outputUnitData.mainOutputUnit; var backendStrategy = compiler.backendStrategy; - // ignore: deprecated_member_use_from_same_package var classes = backendStrategy.emitterTask.neededClasses; var inputElement = classes.where((e) => e.name == 'InputElement').single; dynamic lib1 = lookupLibrary("memory:lib1.dart");