Skip to content

Commit 82f1f2f

Browse files
scheglovcommit-bot@chromium.org
authored andcommitted
Remove AnalysisOptionsImpl.strongModeHints
Change-Id: I61b8aefb4935160bec20e52fb9c9482079387c74 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128848 Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
1 parent 6efbe7f commit 82f1f2f

File tree

5 files changed

+8
-24
lines changed

5 files changed

+8
-24
lines changed

pkg/analysis_server/lib/src/status/diagnostics.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,6 @@ class ContextsPage extends DiagnosticPageWithNav {
500500
writeOption('Generate errors in SDK files', options.generateSdkErrors));
501501
b.write(writeOption('Generate hints', options.hint));
502502
b.write(writeOption('Preserve comments', options.preserveComments));
503-
b.write(writeOption('Strong mode hints', options.strongModeHints));
504503

505504
return b.toString();
506505
}

pkg/analyzer/lib/src/generated/engine.dart

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -472,12 +472,6 @@ class AnalysisOptionsImpl implements AnalysisOptions {
472472
@override
473473
bool preserveComments = true;
474474

475-
/// A flag indicating whether strong-mode inference hints should be
476-
/// used. This flag is not exposed in the interface, and should be
477-
/// replaced by something more general.
478-
// TODO(leafp): replace this with something more general
479-
bool strongModeHints = false;
480-
481475
@override
482476
bool trackCacheDependencies = true;
483477

@@ -541,7 +535,6 @@ class AnalysisOptionsImpl implements AnalysisOptions {
541535
preserveComments = options.preserveComments;
542536
useFastaParser = options.useFastaParser;
543537
if (options is AnalysisOptionsImpl) {
544-
strongModeHints = options.strongModeHints;
545538
implicitCasts = options.implicitCasts;
546539
implicitDynamic = options.implicitDynamic;
547540
strictInference = options.strictInference;
@@ -718,7 +711,6 @@ class AnalysisOptionsImpl implements AnalysisOptions {
718711
buffer.addBool(implicitDynamic);
719712
buffer.addBool(strictInference);
720713
buffer.addBool(strictRawTypes);
721-
buffer.addBool(strongModeHints);
722714
buffer.addBool(useFastaParser);
723715

724716
// Append enabled experiments.
@@ -810,7 +802,6 @@ class AnalysisOptionsImpl implements AnalysisOptions {
810802
_lintRules = null;
811803
patchPaths = {};
812804
preserveComments = true;
813-
strongModeHints = false;
814805
trackCacheDependencies = true;
815806
useFastaParser = true;
816807
}
@@ -819,9 +810,6 @@ class AnalysisOptionsImpl implements AnalysisOptions {
819810
@override
820811
void setCrossContextOptionsFrom(AnalysisOptions options) {
821812
enableLazyAssignmentOperators = options.enableLazyAssignmentOperators;
822-
if (options is AnalysisOptionsImpl) {
823-
strongModeHints = options.strongModeHints;
824-
}
825813
}
826814

827815
/// Return whether the given lists of lints are equal.

pkg/analyzer/lib/src/task/strong/checker.dart

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1006,15 +1006,14 @@ class CodeChecker extends RecursiveAstVisitor {
10061006
errorCode.name.startsWith('TOP_LEVEL_')) {
10071007
severity = ErrorSeverity.ERROR;
10081008
}
1009-
if (severity != ErrorSeverity.INFO || _options.strongModeHints) {
1010-
int begin = node is AnnotatedNode
1011-
? node.firstTokenAfterCommentAndMetadata.offset
1012-
: node.offset;
1013-
int length = node.end - begin;
1014-
var source = (node.root as CompilationUnit).declaredElement.source;
1015-
var error = AnalysisError(source, begin, length, errorCode, arguments);
1016-
reporter.onError(error);
1017-
}
1009+
1010+
int begin = node is AnnotatedNode
1011+
? node.firstTokenAfterCommentAndMetadata.offset
1012+
: node.offset;
1013+
int length = node.end - begin;
1014+
var source = (node.root as CompilationUnit).declaredElement.source;
1015+
var error = AnalysisError(source, begin, length, errorCode, arguments);
1016+
reporter.onError(error);
10181017
}
10191018

10201019
void _validateTopLevelInitializer(String name, Expression n) {

pkg/analyzer/test/src/context/builder_test.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -878,7 +878,6 @@ environment:
878878
);
879879
expect(actual.preserveComments, expected.preserveComments);
880880
expect(actual.strongMode, expected.strongMode);
881-
expect(actual.strongModeHints, expected.strongModeHints);
882881
expect(actual.implicitCasts, expected.implicitCasts);
883882
expect(actual.implicitDynamic, expected.implicitDynamic);
884883
expect(actual.strictInference, expected.strictInference);

pkg/analyzer/test/src/task/strong/strong_test_helper.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,6 @@ class AbstractStrongTest with ResourceProviderMixin {
273273
expect(mainFile.exists, true, reason: '`/main.dart` is missing');
274274

275275
AnalysisOptionsImpl analysisOptions = AnalysisOptionsImpl();
276-
analysisOptions.strongModeHints = true;
277276
analysisOptions.implicitCasts = implicitCasts;
278277
analysisOptions.implicitDynamic = implicitDynamic;
279278
analysisOptions.strictInference = strictInference;

0 commit comments

Comments
 (0)