Skip to content

Commit

Permalink
[cfe] Remove isNonNullableByDefault argument from messages
Browse files Browse the repository at this point in the history
Legacy libraries are no longer supported so nullabilities are always
shown in messages.

TEST=existing

Change-Id: Ic1a444c3f5d98baff70a60a2ad0d316d487ea250
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/365824
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
  • Loading branch information
johnniwinther authored and Commit Queue committed May 14, 2024
1 parent 452844e commit 310775b
Show file tree
Hide file tree
Showing 30 changed files with 1,537 additions and 2,299 deletions.
8 changes: 4 additions & 4 deletions pkg/_js_interop_checks/lib/js_interop_checks.dart
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ class JsInteropChecks extends RecursiveVisitor {
!extensionIndex.isInteropExtensionType(node)) {
_reporter.report(
templateJsInteropExtensionTypeNotInterop.withArguments(
node.name, node.declaredRepresentationType, true),
node.name, node.declaredRepresentationType),
node.fileOffset,
node.name.length,
node.fileUri);
Expand Down Expand Up @@ -742,8 +742,8 @@ class JsInteropChecks extends RecursiveVisitor {
final argument = node.arguments.positional.single;
final functionType = argument.getStaticType(_staticTypeContext);
if (functionType is! FunctionType) {
report(templateJsInteropFunctionToJSRequiresStaticType.withArguments(
functionType, true));
report(templateJsInteropFunctionToJSRequiresStaticType
.withArguments(functionType));
} else {
if (functionType.typeParameters.isNotEmpty) {
report(messageJsInteropFunctionToJSTypeParameters);
Expand Down Expand Up @@ -1008,7 +1008,7 @@ class JsInteropChecks extends RecursiveVisitor {
if (!_isAllowedExternalType(accessorType)) {
_reporter.report(
templateJsInteropStaticInteropExternalAccessorTypeViolation
.withArguments(accessorType, true),
.withArguments(accessorType),
node.fileOffset,
node.name.text.length,
node.location?.file);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ class SharedInteropTransformer extends Transformer {
// invocation.
if (!_inIsATearoff) {
_diagnosticReporter.report(
templateJsInteropIsAInvalidType.withArguments(interopType, true),
templateJsInteropIsAInvalidType.withArguments(interopType),
invocation.fileOffset,
invocation.name.text.length,
invocation.location?.file);
Expand Down Expand Up @@ -193,8 +193,7 @@ class SharedInteropTransformer extends Transformer {
bool _verifyExportable(DartType dartType) {
if (dartType is! InterfaceType) {
_diagnosticReporter.report(
templateJsInteropExportInvalidTypeArgument.withArguments(
dartType, true),
templateJsInteropExportInvalidTypeArgument.withArguments(dartType),
invocation.fileOffset,
invocation.name.text.length,
invocation.location?.file);
Expand All @@ -205,8 +204,8 @@ class SharedInteropTransformer extends Transformer {
js_interop.hasStaticInteropAnnotation(dartClass) ||
js_interop.hasAnonymousAnnotation(dartClass)) {
_diagnosticReporter.report(
templateJsInteropExportInvalidInteropTypeArgument.withArguments(
dartType, true),
templateJsInteropExportInvalidInteropTypeArgument
.withArguments(dartType),
invocation.fileOffset,
invocation.name.text.length,
invocation.location?.file);
Expand Down Expand Up @@ -468,8 +467,8 @@ class SharedInteropTransformer extends Transformer {
if (descriptorNode is Procedure &&
_extensionIndex.isLiteralConstructor(descriptorNode)) {
_diagnosticReporter.report(
templateJsInteropIsAObjectLiteralType.withArguments(
interopType, true),
templateJsInteropIsAObjectLiteralType
.withArguments(interopType),
invocation.fileOffset,
invocation.name.text.length,
invocation.location?.file);
Expand All @@ -496,7 +495,7 @@ class SharedInteropTransformer extends Transformer {
if (interopTypeDecl != jsType) {
_diagnosticReporter.report(
templateJsInteropIsAPrimitiveExtensionType.withArguments(
interopType, jsTypeName, true),
interopType, jsTypeName),
invocation.fileOffset,
invocation.name.text.length,
invocation.location?.file);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ class StaticInteropMockValidator {
if (staticInteropType is! InterfaceType ||
!js_interop.hasStaticInteropAnnotation(staticInteropType.classNode)) {
_diagnosticReporter.report(
templateJsInteropStaticInteropMockNotStaticInteropType.withArguments(
staticInteropType, true),
templateJsInteropStaticInteropMockNotStaticInteropType
.withArguments(staticInteropType),
node.fileOffset,
node.name.text.length,
node.location?.file);
Expand Down Expand Up @@ -82,7 +82,7 @@ class StaticInteropMockValidator {
if (arg is! DynamicType && arg != typeParams[i].bound) {
_diagnosticReporter.report(
templateJsInteropStaticInteropMockTypeParametersNotAllowed
.withArguments(type, true),
.withArguments(type),
node.fileOffset,
node.name.text.length,
node.location?.file);
Expand Down
4 changes: 2 additions & 2 deletions pkg/front_end/lib/src/fasta/builder/named_type_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -350,10 +350,10 @@ abstract class NamedTypeBuilderImpl extends NamedTypeBuilder {
templateSupertypeIsTypeVariable.withArguments(fullNameForErrors);
} else if (type.nullability == Nullability.nullable) {
message = templateSupertypeIsNullableAliased.withArguments(
fullNameForErrors, type, true);
fullNameForErrors, type);
} else {
message = templateSupertypeIsIllegalAliased.withArguments(
fullNameForErrors, type, true);
fullNameForErrors, type);
}
library.addProblem(message, charOffset!, noLength, fileUri, context: [
messageTypedefCause.withLocation(
Expand Down

0 comments on commit 310775b

Please sign in to comment.