[CFE] Remove ignored messages and the code issuing it
Do keep ignored messages about extending, implementing and mixing in 'Function' though, as they should (at some point) be warnings or similar. Change-Id: I7571df6ade944d1e83136d9e686e0882007dca8a Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184265 Commit-Queue: Jens Johansen <jensj@google.com> Reviewed-by: Johnni Winther <johnniwinther@google.com>
This commit is contained in:
committed by
commit-bot@chromium.org
parent
1e114a88d0
commit
dfd589a8e5
@@ -2391,32 +2391,6 @@ Message _withArgumentsDuplicatedExportInType(String name, Uri uri_, Uri uri2_) {
|
||||
arguments: {'name': name, 'uri': uri_, 'uri2': uri2_});
|
||||
}
|
||||
|
||||
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
|
||||
const Template<Message Function(String name, Uri uri_, Uri uri2_)>
|
||||
templateDuplicatedImport =
|
||||
const Template<Message Function(String name, Uri uri_, Uri uri2_)>(
|
||||
messageTemplate:
|
||||
r"""'#name' is imported from both '#uri' and '#uri2'.""",
|
||||
withArguments: _withArgumentsDuplicatedImport);
|
||||
|
||||
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
|
||||
const Code<Message Function(String name, Uri uri_, Uri uri2_)>
|
||||
codeDuplicatedImport =
|
||||
const Code<Message Function(String name, Uri uri_, Uri uri2_)>(
|
||||
"DuplicatedImport",
|
||||
severity: Severity.ignored);
|
||||
|
||||
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
|
||||
Message _withArgumentsDuplicatedImport(String name, Uri uri_, Uri uri2_) {
|
||||
if (name.isEmpty) throw 'No name provided';
|
||||
name = demangleMixinApplicationName(name);
|
||||
String? uri = relativizeUri(uri_);
|
||||
String? uri2 = relativizeUri(uri2_);
|
||||
return new Message(codeDuplicatedImport,
|
||||
message: """'${name}' is imported from both '${uri}' and '${uri2}'.""",
|
||||
arguments: {'name': name, 'uri': uri_, 'uri2': uri2_});
|
||||
}
|
||||
|
||||
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
|
||||
const Template<Message Function(String name, Uri uri_, Uri uri2_)>
|
||||
templateDuplicatedImportInType =
|
||||
@@ -3243,33 +3217,6 @@ const MessageCode messageExportAfterPart = const MessageCode("ExportAfterPart",
|
||||
message: r"""Export directives must precede part directives.""",
|
||||
tip: r"""Try moving the export directives before the part directives.""");
|
||||
|
||||
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
|
||||
const Template<Message Function(String name, Uri uri_, Uri uri2_)>
|
||||
templateExportHidesExport =
|
||||
const Template<Message Function(String name, Uri uri_, Uri uri2_)>(
|
||||
messageTemplate:
|
||||
r"""Export of '#name' (from '#uri') hides export from '#uri2'.""",
|
||||
withArguments: _withArgumentsExportHidesExport);
|
||||
|
||||
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
|
||||
const Code<Message Function(String name, Uri uri_, Uri uri2_)>
|
||||
codeExportHidesExport =
|
||||
const Code<Message Function(String name, Uri uri_, Uri uri2_)>(
|
||||
"ExportHidesExport",
|
||||
severity: Severity.ignored);
|
||||
|
||||
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
|
||||
Message _withArgumentsExportHidesExport(String name, Uri uri_, Uri uri2_) {
|
||||
if (name.isEmpty) throw 'No name provided';
|
||||
name = demangleMixinApplicationName(name);
|
||||
String? uri = relativizeUri(uri_);
|
||||
String? uri2 = relativizeUri(uri2_);
|
||||
return new Message(codeExportHidesExport,
|
||||
message:
|
||||
"""Export of '${name}' (from '${uri}') hides export from '${uri2}'.""",
|
||||
arguments: {'name': name, 'uri': uri_, 'uri2': uri2_});
|
||||
}
|
||||
|
||||
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
|
||||
const Code<Null> codeExportOptOutFromOptIn = messageExportOptOutFromOptIn;
|
||||
|
||||
@@ -4625,33 +4572,6 @@ const MessageCode messageImportAfterPart = const MessageCode("ImportAfterPart",
|
||||
message: r"""Import directives must precede part directives.""",
|
||||
tip: r"""Try moving the import directives before the part directives.""");
|
||||
|
||||
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
|
||||
const Template<Message Function(String name, Uri uri_, Uri uri2_)>
|
||||
templateImportHidesImport =
|
||||
const Template<Message Function(String name, Uri uri_, Uri uri2_)>(
|
||||
messageTemplate:
|
||||
r"""Import of '#name' (from '#uri') hides import from '#uri2'.""",
|
||||
withArguments: _withArgumentsImportHidesImport);
|
||||
|
||||
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
|
||||
const Code<Message Function(String name, Uri uri_, Uri uri2_)>
|
||||
codeImportHidesImport =
|
||||
const Code<Message Function(String name, Uri uri_, Uri uri2_)>(
|
||||
"ImportHidesImport",
|
||||
severity: Severity.ignored);
|
||||
|
||||
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
|
||||
Message _withArgumentsImportHidesImport(String name, Uri uri_, Uri uri2_) {
|
||||
if (name.isEmpty) throw 'No name provided';
|
||||
name = demangleMixinApplicationName(name);
|
||||
String? uri = relativizeUri(uri_);
|
||||
String? uri2 = relativizeUri(uri2_);
|
||||
return new Message(codeImportHidesImport,
|
||||
message:
|
||||
"""Import of '${name}' (from '${uri}') hides import from '${uri2}'.""",
|
||||
arguments: {'name': name, 'uri': uri_, 'uri2': uri2_});
|
||||
}
|
||||
|
||||
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
|
||||
const Code<Null> codeIncorrectTypeArgumentVariable =
|
||||
messageIncorrectTypeArgumentVariable;
|
||||
@@ -6254,30 +6174,6 @@ const MessageCode messageListLiteralTooManyTypeArguments = const MessageCode(
|
||||
analyzerCodes: <String>["EXPECTED_ONE_LIST_TYPE_ARGUMENTS"],
|
||||
message: r"""List literal requires exactly one type argument.""");
|
||||
|
||||
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
|
||||
const Template<
|
||||
Message Function(Uri uri_)> templateLoadLibraryHidesMember = const Template<
|
||||
Message Function(Uri uri_)>(
|
||||
messageTemplate:
|
||||
r"""The library '#uri' defines a top-level member named 'loadLibrary'. This member is hidden by the special member 'loadLibrary' that the language adds to support deferred loading.""",
|
||||
tipTemplate: r"""Try to rename or hide the member.""",
|
||||
withArguments: _withArgumentsLoadLibraryHidesMember);
|
||||
|
||||
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
|
||||
const Code<Message Function(Uri uri_)> codeLoadLibraryHidesMember =
|
||||
const Code<Message Function(Uri uri_)>("LoadLibraryHidesMember",
|
||||
severity: Severity.ignored);
|
||||
|
||||
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
|
||||
Message _withArgumentsLoadLibraryHidesMember(Uri uri_) {
|
||||
String? uri = relativizeUri(uri_);
|
||||
return new Message(codeLoadLibraryHidesMember,
|
||||
message:
|
||||
"""The library '${uri}' defines a top-level member named 'loadLibrary'. This member is hidden by the special member 'loadLibrary' that the language adds to support deferred loading.""",
|
||||
tip: """Try to rename or hide the member.""",
|
||||
arguments: {'uri': uri_});
|
||||
}
|
||||
|
||||
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
|
||||
const Code<Null> codeLoadLibraryTakesNoArguments =
|
||||
messageLoadLibraryTakesNoArguments;
|
||||
@@ -6288,56 +6184,6 @@ const MessageCode messageLoadLibraryTakesNoArguments = const MessageCode(
|
||||
analyzerCodes: <String>["LOAD_LIBRARY_TAKES_NO_ARGUMENTS"],
|
||||
message: r"""'loadLibrary' takes no arguments.""");
|
||||
|
||||
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
|
||||
const Template<Message Function(String name, Uri uri_)>
|
||||
templateLocalDefinitionHidesExport =
|
||||
const Template<Message Function(String name, Uri uri_)>(
|
||||
messageTemplate:
|
||||
r"""Local definition of '#name' hides export from '#uri'.""",
|
||||
withArguments: _withArgumentsLocalDefinitionHidesExport);
|
||||
|
||||
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
|
||||
const Code<Message Function(String name, Uri uri_)>
|
||||
codeLocalDefinitionHidesExport =
|
||||
const Code<Message Function(String name, Uri uri_)>(
|
||||
"LocalDefinitionHidesExport",
|
||||
severity: Severity.ignored);
|
||||
|
||||
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
|
||||
Message _withArgumentsLocalDefinitionHidesExport(String name, Uri uri_) {
|
||||
if (name.isEmpty) throw 'No name provided';
|
||||
name = demangleMixinApplicationName(name);
|
||||
String? uri = relativizeUri(uri_);
|
||||
return new Message(codeLocalDefinitionHidesExport,
|
||||
message: """Local definition of '${name}' hides export from '${uri}'.""",
|
||||
arguments: {'name': name, 'uri': uri_});
|
||||
}
|
||||
|
||||
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
|
||||
const Template<Message Function(String name, Uri uri_)>
|
||||
templateLocalDefinitionHidesImport =
|
||||
const Template<Message Function(String name, Uri uri_)>(
|
||||
messageTemplate:
|
||||
r"""Local definition of '#name' hides import from '#uri'.""",
|
||||
withArguments: _withArgumentsLocalDefinitionHidesImport);
|
||||
|
||||
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
|
||||
const Code<Message Function(String name, Uri uri_)>
|
||||
codeLocalDefinitionHidesImport =
|
||||
const Code<Message Function(String name, Uri uri_)>(
|
||||
"LocalDefinitionHidesImport",
|
||||
severity: Severity.ignored);
|
||||
|
||||
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
|
||||
Message _withArgumentsLocalDefinitionHidesImport(String name, Uri uri_) {
|
||||
if (name.isEmpty) throw 'No name provided';
|
||||
name = demangleMixinApplicationName(name);
|
||||
String? uri = relativizeUri(uri_);
|
||||
return new Message(codeLocalDefinitionHidesImport,
|
||||
message: """Local definition of '${name}' hides import from '${uri}'.""",
|
||||
arguments: {'name': name, 'uri': uri_});
|
||||
}
|
||||
|
||||
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
|
||||
const Code<Null> codeMainNotFunctionDeclaration =
|
||||
messageMainNotFunctionDeclaration;
|
||||
@@ -6509,27 +6355,6 @@ const MessageCode messageMissingExplicitConst = const MessageCode(
|
||||
message: r"""Constant expression expected.""",
|
||||
tip: r"""Try inserting 'const'.""");
|
||||
|
||||
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
|
||||
const Template<Message Function(int count)>
|
||||
templateMissingExplicitTypeArguments =
|
||||
const Template<Message Function(int count)>(
|
||||
messageTemplate: r"""No type arguments provided, #count possible.""",
|
||||
withArguments: _withArgumentsMissingExplicitTypeArguments);
|
||||
|
||||
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
|
||||
const Code<Message Function(int count)> codeMissingExplicitTypeArguments =
|
||||
const Code<Message Function(int count)>("MissingExplicitTypeArguments",
|
||||
severity: Severity.ignored);
|
||||
|
||||
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
|
||||
Message _withArgumentsMissingExplicitTypeArguments(int count) {
|
||||
// ignore: unnecessary_null_comparison
|
||||
if (count == null) throw 'No count provided';
|
||||
return new Message(codeMissingExplicitTypeArguments,
|
||||
message: """No type arguments provided, ${count} possible.""",
|
||||
arguments: {'count': count});
|
||||
}
|
||||
|
||||
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
|
||||
const Code<Null> codeMissingExponent = messageMissingExponent;
|
||||
|
||||
|
||||
@@ -21,7 +21,6 @@ import '../fasta_codes.dart'
|
||||
messageTypedefCause,
|
||||
noLength,
|
||||
templateExtendingRestricted,
|
||||
templateMissingExplicitTypeArguments,
|
||||
templateNotAType,
|
||||
templateSupertypeIsIllegal,
|
||||
templateSupertypeIsTypeVariable,
|
||||
@@ -142,23 +141,6 @@ class NamedTypeBuilder extends TypeBuilder {
|
||||
} else if (member is TypeDeclarationBuilder) {
|
||||
declaration = member.origin;
|
||||
if (!declaration.isExtension) {
|
||||
if (arguments == null && declaration.typeVariablesCount != 0) {
|
||||
String typeName;
|
||||
int typeNameOffset;
|
||||
if (name is Identifier) {
|
||||
typeName = name.name;
|
||||
typeNameOffset = name.charOffset;
|
||||
} else {
|
||||
typeName = name;
|
||||
typeNameOffset = charOffset;
|
||||
}
|
||||
library.addProblem(
|
||||
templateMissingExplicitTypeArguments
|
||||
.withArguments(declaration.typeVariablesCount),
|
||||
typeNameOffset,
|
||||
typeName.length,
|
||||
fileUri);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2995,12 +2995,6 @@ class TypeUseGenerator extends ReadOnlyAccessGenerator {
|
||||
// as a recovery node once the IR can represent it (Issue #29840).
|
||||
arguments = null;
|
||||
}
|
||||
} else if (declaration.typeVariablesCount != 0) {
|
||||
_helper.addProblem(
|
||||
templateMissingExplicitTypeArguments
|
||||
.withArguments(declaration.typeVariablesCount),
|
||||
fileOffset,
|
||||
lengthForToken(token));
|
||||
}
|
||||
|
||||
List<TypeBuilder> argumentBuilders;
|
||||
|
||||
@@ -2707,54 +2707,25 @@ class SourceLibraryBuilder extends LibraryBuilderImpl {
|
||||
AccessErrorBuilder error = other;
|
||||
other = error.builder;
|
||||
}
|
||||
bool isLocal = false;
|
||||
bool isLoadLibrary = false;
|
||||
Builder preferred;
|
||||
Uri uri;
|
||||
Uri otherUri;
|
||||
Uri preferredUri;
|
||||
Uri hiddenUri;
|
||||
if (scope.lookupLocalMember(name, setter: false) == declaration) {
|
||||
isLocal = true;
|
||||
preferred = declaration;
|
||||
hiddenUri = computeLibraryUri(other);
|
||||
} else {
|
||||
uri = computeLibraryUri(declaration);
|
||||
otherUri = computeLibraryUri(other);
|
||||
if (declaration is LoadLibraryBuilder) {
|
||||
isLoadLibrary = true;
|
||||
preferred = declaration;
|
||||
preferredUri = otherUri;
|
||||
} else if (other is LoadLibraryBuilder) {
|
||||
isLoadLibrary = true;
|
||||
preferred = other;
|
||||
preferredUri = uri;
|
||||
} else if (otherUri?.scheme == "dart" && uri?.scheme != "dart") {
|
||||
preferred = declaration;
|
||||
preferredUri = uri;
|
||||
hiddenUri = otherUri;
|
||||
} else if (uri?.scheme == "dart" && otherUri?.scheme != "dart") {
|
||||
preferred = other;
|
||||
preferredUri = otherUri;
|
||||
hiddenUri = uri;
|
||||
}
|
||||
}
|
||||
if (preferred != null) {
|
||||
if (isLocal) {
|
||||
Template<Message Function(String name, Uri uri)> template = isExport
|
||||
? templateLocalDefinitionHidesExport
|
||||
: templateLocalDefinitionHidesImport;
|
||||
addProblem(template.withArguments(name, hiddenUri), charOffset,
|
||||
noLength, fileUri);
|
||||
} else if (isLoadLibrary) {
|
||||
addProblem(templateLoadLibraryHidesMember.withArguments(preferredUri),
|
||||
charOffset, noLength, fileUri);
|
||||
} else {
|
||||
Template<Message Function(String name, Uri uri, Uri uri2)> template =
|
||||
isExport ? templateExportHidesExport : templateImportHidesImport;
|
||||
addProblem(template.withArguments(name, preferredUri, hiddenUri),
|
||||
charOffset, noLength, fileUri);
|
||||
}
|
||||
return preferred;
|
||||
}
|
||||
if (declaration.next == null && other.next == null) {
|
||||
@@ -2770,15 +2741,17 @@ class SourceLibraryBuilder extends LibraryBuilderImpl {
|
||||
});
|
||||
}
|
||||
}
|
||||
Template<Message Function(String name, Uri uri, Uri uri2)> template =
|
||||
isExport ? templateDuplicatedExport : templateDuplicatedImport;
|
||||
Message message = template.withArguments(name, uri, otherUri);
|
||||
addProblem(message, charOffset, noLength, fileUri);
|
||||
if (isExport) {
|
||||
Template<Message Function(String name, Uri uri, Uri uri2)> template =
|
||||
templateDuplicatedExport;
|
||||
Message message = template.withArguments(name, uri, otherUri);
|
||||
addProblem(message, charOffset, noLength, fileUri);
|
||||
}
|
||||
Template<Message Function(String name, Uri uri, Uri uri2)> builderTemplate =
|
||||
isExport
|
||||
? templateDuplicatedExportInType
|
||||
: templateDuplicatedImportInType;
|
||||
message = builderTemplate.withArguments(
|
||||
Message message = builderTemplate.withArguments(
|
||||
name,
|
||||
// TODO(ahe): We should probably use a context object here
|
||||
// instead of including URIs in this message.
|
||||
|
||||
@@ -1677,11 +1677,6 @@ LoadLibraryTakesNoArguments:
|
||||
template: "'loadLibrary' takes no arguments."
|
||||
analyzerCode: LOAD_LIBRARY_TAKES_NO_ARGUMENTS
|
||||
|
||||
LoadLibraryHidesMember:
|
||||
template: "The library '#uri' defines a top-level member named 'loadLibrary'. This member is hidden by the special member 'loadLibrary' that the language adds to support deferred loading."
|
||||
tip: "Try to rename or hide the member."
|
||||
severity: IGNORED
|
||||
|
||||
TypeArgumentMismatch:
|
||||
template: "Expected #count type arguments."
|
||||
analyzerCode: WRONG_NUMBER_OF_TYPE_ARGUMENTS
|
||||
@@ -1925,26 +1920,10 @@ IncrementalCompilerIllegalParameter:
|
||||
IncrementalCompilerIllegalTypeParameter:
|
||||
template: "Illegal type parameter name '#string' found during expression compilation."
|
||||
|
||||
LocalDefinitionHidesExport:
|
||||
template: "Local definition of '#name' hides export from '#uri'."
|
||||
severity: IGNORED
|
||||
|
||||
LocalDefinitionHidesImport:
|
||||
template: "Local definition of '#name' hides import from '#uri'."
|
||||
severity: IGNORED
|
||||
|
||||
DebugTrace:
|
||||
template: "Fatal '#name' at:\n#string"
|
||||
severity: IGNORED
|
||||
|
||||
ExportHidesExport:
|
||||
template: "Export of '#name' (from '#uri') hides export from '#uri2'."
|
||||
severity: IGNORED
|
||||
|
||||
ImportHidesImport:
|
||||
template: "Import of '#name' (from '#uri') hides import from '#uri2'."
|
||||
severity: IGNORED
|
||||
|
||||
MissingPrefixInDeferredImport:
|
||||
index: 30
|
||||
template: "Deferred imports should have a prefix."
|
||||
@@ -1991,10 +1970,6 @@ DuplicatedExport:
|
||||
DuplicatedExportInType:
|
||||
template: "'#name' is exported from both '#uri' and '#uri2'."
|
||||
|
||||
DuplicatedImport:
|
||||
template: "'#name' is imported from both '#uri' and '#uri2'."
|
||||
severity: IGNORED
|
||||
|
||||
DuplicatedImportInType:
|
||||
template: "'#name' is imported from both '#uri' and '#uri2'."
|
||||
analyzerCode: AMBIGUOUS_IMPORT
|
||||
@@ -3777,10 +3752,6 @@ InitializeFromDillUnknownProblemNoDump:
|
||||
frontendInternal: true
|
||||
external: test/incremental_load_from_invalid_dill_test.dart
|
||||
|
||||
MissingExplicitTypeArguments:
|
||||
template: "No type arguments provided, #count possible."
|
||||
severity: IGNORED
|
||||
|
||||
WebLiteralCannotBeRepresentedExactly:
|
||||
template: "The integer literal #string can't be represented exactly in JavaScript."
|
||||
tip: "Try changing the literal to something that can be represented in Javascript. In Javascript #string2 is the nearest value that can be represented exactly."
|
||||
|
||||
Reference in New Issue
Block a user