From 4dff1b3b0ad72d64ccd01eb0b79659069846cbd7 Mon Sep 17 00:00:00 2001 From: Chloe Stefantsova Date: Wed, 31 Jan 2024 08:46:40 +0000 Subject: [PATCH] [cfe] Report errors on attempts to call a record type Closes https://github.com/dart-lang/sdk/issues/54616 Change-Id: Ib0a74ae139a56e0660b3cfb00127c898d693a03c Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/349000 Reviewed-by: Johnni Winther Commit-Queue: Chloe Stefantsova --- .../lib/src/messages/codes_generated.dart | 9 + .../inference_visitor_base.dart | 8 +- pkg/front_end/messages.status | 15 +- pkg/front_end/messages.yaml | 5 + .../testcases/records/issue54616.dart | 17 ++ .../records/issue54616.dart.strong.expect | 39 +++++ .../issue54616.dart.strong.transformed.expect | 39 +++++ .../issue54616.dart.textual_outline.expect | 3 + ...54616.dart.textual_outline_modelled.expect | 3 + .../records/issue54616.dart.weak.expect | 39 +++++ .../issue54616.dart.weak.modular.expect | 39 +++++ .../issue54616.dart.weak.outline.expect | 8 + .../issue54616.dart.weak.transformed.expect | 39 +++++ .../testcases/records/issue54616_2.dart | 52 ++++++ .../records/issue54616_2.dart.strong.expect | 161 ++++++++++++++++++ ...ssue54616_2.dart.strong.transformed.expect | 161 ++++++++++++++++++ .../issue54616_2.dart.textual_outline.expect | 25 +++ ...616_2.dart.textual_outline_modelled.expect | 25 +++ .../records/issue54616_2.dart.weak.expect | 161 ++++++++++++++++++ .../issue54616_2.dart.weak.modular.expect | 161 ++++++++++++++++++ .../issue54616_2.dart.weak.outline.expect | 22 +++ .../issue54616_2.dart.weak.transformed.expect | 161 ++++++++++++++++++ 22 files changed, 1184 insertions(+), 8 deletions(-) create mode 100644 pkg/front_end/testcases/records/issue54616.dart create mode 100644 pkg/front_end/testcases/records/issue54616.dart.strong.expect create mode 100644 pkg/front_end/testcases/records/issue54616.dart.strong.transformed.expect create mode 100644 pkg/front_end/testcases/records/issue54616.dart.textual_outline.expect create mode 100644 pkg/front_end/testcases/records/issue54616.dart.textual_outline_modelled.expect create mode 100644 pkg/front_end/testcases/records/issue54616.dart.weak.expect create mode 100644 pkg/front_end/testcases/records/issue54616.dart.weak.modular.expect create mode 100644 pkg/front_end/testcases/records/issue54616.dart.weak.outline.expect create mode 100644 pkg/front_end/testcases/records/issue54616.dart.weak.transformed.expect create mode 100644 pkg/front_end/testcases/records/issue54616_2.dart create mode 100644 pkg/front_end/testcases/records/issue54616_2.dart.strong.expect create mode 100644 pkg/front_end/testcases/records/issue54616_2.dart.strong.transformed.expect create mode 100644 pkg/front_end/testcases/records/issue54616_2.dart.textual_outline.expect create mode 100644 pkg/front_end/testcases/records/issue54616_2.dart.textual_outline_modelled.expect create mode 100644 pkg/front_end/testcases/records/issue54616_2.dart.weak.expect create mode 100644 pkg/front_end/testcases/records/issue54616_2.dart.weak.modular.expect create mode 100644 pkg/front_end/testcases/records/issue54616_2.dart.weak.outline.expect create mode 100644 pkg/front_end/testcases/records/issue54616_2.dart.weak.transformed.expect diff --git a/pkg/_fe_analyzer_shared/lib/src/messages/codes_generated.dart b/pkg/_fe_analyzer_shared/lib/src/messages/codes_generated.dart index 9050539f88b..6c43d478b5e 100644 --- a/pkg/_fe_analyzer_shared/lib/src/messages/codes_generated.dart +++ b/pkg/_fe_analyzer_shared/lib/src/messages/codes_generated.dart @@ -12672,6 +12672,15 @@ const MessageCode messageRecordTypeZeroFieldsButTrailingComma = r"""A record type without fields can't have a trailing comma.""", correctionMessage: r"""Try removing the trailing comma."""); +// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. +const Code codeRecordUsedAsCallable = messageRecordUsedAsCallable; + +// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. +const MessageCode messageRecordUsedAsCallable = const MessageCode( + "RecordUsedAsCallable", + problemMessage: + r"""The 'call' property on the record type isn't directly callable but could be invoked by `.call(...)`"""); + // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Code codeRedirectingConstructorWithAnotherInitializer = messageRedirectingConstructorWithAnotherInitializer; diff --git a/pkg/front_end/lib/src/fasta/type_inference/inference_visitor_base.dart b/pkg/front_end/lib/src/fasta/type_inference/inference_visitor_base.dart index 1fa62f13f84..a510b4138de 100644 --- a/pkg/front_end/lib/src/fasta/type_inference/inference_visitor_base.dart +++ b/pkg/front_end/lib/src/fasta/type_inference/inference_visitor_base.dart @@ -9,8 +9,6 @@ import 'package:_fe_analyzer_shared/src/flow_analysis/flow_analysis_operations.d import 'package:_fe_analyzer_shared/src/type_inference/assigned_variables.dart'; import 'package:_fe_analyzer_shared/src/testing/id.dart'; import 'package:_fe_analyzer_shared/src/util/link.dart'; -import 'package:front_end/src/fasta/source/source_field_builder.dart'; -import 'package:front_end/src/fasta/source/source_procedure_builder.dart'; import 'package:kernel/ast.dart'; import 'package:kernel/class_hierarchy.dart' show ClassHierarchyBase, ClassHierarchyMembers; @@ -43,8 +41,10 @@ import '../kernel/type_algorithms.dart' show hasAnyTypeVariables; import '../names.dart'; import '../problems.dart' show internalProblem, unhandled; import '../source/source_constructor_builder.dart'; +import '../source/source_field_builder.dart'; import '../source/source_library_builder.dart' show FieldNonPromotabilityInfo, SourceLibraryBuilder; +import '../source/source_procedure_builder.dart'; import '../util/helpers.dart'; import 'closure_context.dart'; import 'external_ast_helper.dart'; @@ -3380,6 +3380,10 @@ abstract class InferenceVisitorBase implements InferenceVisitor { hoistedExpressions: hoistedExpressions); case ObjectAccessTargetKind.recordNamed: case ObjectAccessTargetKind.nullableRecordNamed: + if (isImplicitCall && !target.isNullable) { + libraryBuilder.addProblem(messageRecordUsedAsCallable, + receiver.fileOffset, noLength, libraryBuilder.fileUri); + } DartType type = target.getGetterType(this); Expression read = new RecordNameGet(receiver, target.receiverType as RecordType, target.recordFieldName!) diff --git a/pkg/front_end/messages.status b/pkg/front_end/messages.status index 3b16793279d..5bdee20c007 100644 --- a/pkg/front_end/messages.status +++ b/pkg/front_end/messages.status @@ -631,6 +631,12 @@ JsInteropExternalExtensionMemberWithStaticDisallowed/analyzerCode: Fail # Web co JsInteropExternalExtensionMemberWithStaticDisallowed/example: Fail # Web compiler specific JsInteropExternalMemberNotJSAnnotated/analyzerCode: Fail # Web compiler specific JsInteropExternalMemberNotJSAnnotated/example: Fail # Web compiler specific +JsInteropFunctionToJSRequiresStaticType/analyzerCode: Fail # Web compiler specific +JsInteropFunctionToJSRequiresStaticType/example: Fail # Web compiler specific +JsInteropFunctionToJSTypeParameters/analyzerCode: Fail # Web compiler specific +JsInteropFunctionToJSTypeParameters/example: Fail # Web compiler specific +JsInteropInvalidStaticClassMemberName/analyzerCode: Fail +JsInteropInvalidStaticClassMemberName/example: Fail JsInteropIsAInvalidType/analyzerCode: Fail # Web compiler specific JsInteropIsAInvalidType/example: Fail # Web compiler specific JsInteropIsAObjectLiteralType/analyzerCode: Fail # Web compiler specific @@ -639,12 +645,6 @@ JsInteropIsAPrimitiveExtensionType/analyzerCode: Fail # Web compiler specific JsInteropIsAPrimitiveExtensionType/example: Fail # Web compiler specific JsInteropIsATearoff/analyzerCode: Fail # Web compiler specific JsInteropIsATearoff/example: Fail # Web compiler specific -JsInteropFunctionToJSRequiresStaticType/analyzerCode: Fail # Web compiler specific -JsInteropFunctionToJSRequiresStaticType/example: Fail # Web compiler specific -JsInteropFunctionToJSTypeParameters/analyzerCode: Fail # Web compiler specific -JsInteropFunctionToJSTypeParameters/example: Fail # Web compiler specific -JsInteropInvalidStaticClassMemberName/analyzerCode: Fail -JsInteropInvalidStaticClassMemberName/example: Fail JsInteropJSClassExtendsDartClass/analyzerCode: Fail # Web compiler specific JsInteropJSClassExtendsDartClass/example: Fail # Web compiler specific JsInteropNamedParameters/analyzerCode: Fail # Web compiler specific @@ -930,6 +930,9 @@ PrefixAfterCombinator/example: Fail PreviousUseOfName/analyzerCode: Fail PreviousUseOfName/example: Fail PrivateNamedParameter/example: Fail +RecordUsedAsCallable/analyzerCode: Fail +RecordUsedAsCallable/part_wrapped_script: Fail +RecordUsedAsCallable/script: Fail RedirectingConstructorWithBody/part_wrapped_script1: Fail RedirectingConstructorWithBody/script1: Fail RedirectingFactoryIncompatibleTypeArgumentWarning/example: Fail diff --git a/pkg/front_end/messages.yaml b/pkg/front_end/messages.yaml index 5adbced5ec6..533841cb56d 100644 --- a/pkg/front_end/messages.yaml +++ b/pkg/front_end/messages.yaml @@ -7619,3 +7619,8 @@ ExtensionTypeImplementsDeferred: extension type ET(d.A id) implements d.A {} lib.dart: | class A {} + +RecordUsedAsCallable: + problemMessage: "The 'call' property on the record type isn't directly callable but could be invoked by `.call(...)`" + script: | + test(({dynamic call} r) => r(0); diff --git a/pkg/front_end/testcases/records/issue54616.dart b/pkg/front_end/testcases/records/issue54616.dart new file mode 100644 index 00000000000..6986c3fef21 --- /dev/null +++ b/pkg/front_end/testcases/records/issue54616.dart @@ -0,0 +1,17 @@ +// Copyright (c) 2024, 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. + +void main() { + var c = (call: (int x) => x); + var v = c(1); // Error. + + var c2 = (call: intId); + var v2 = c2(1); // Error. + + var c3 = (call: (T x) => x); + var v3a = c3(1); // Error. + var v3b = c3("a"); // Error. +} + +int intId(int x) => x; diff --git a/pkg/front_end/testcases/records/issue54616.dart.strong.expect b/pkg/front_end/testcases/records/issue54616.dart.strong.expect new file mode 100644 index 00000000000..6a26646020e --- /dev/null +++ b/pkg/front_end/testcases/records/issue54616.dart.strong.expect @@ -0,0 +1,39 @@ +library; +// +// Problems in library: +// +// pkg/front_end/testcases/records/issue54616.dart:7:11: Error: The 'call' property on the record type isn't directly callable but could be invoked by `.call(...)` +// var v = c(1); // Error. +// ^ +// +// pkg/front_end/testcases/records/issue54616.dart:10:12: Error: The 'call' property on the record type isn't directly callable but could be invoked by `.call(...)` +// var v2 = c2(1); // Error. +// ^ +// +// pkg/front_end/testcases/records/issue54616.dart:13:13: Error: The 'call' property on the record type isn't directly callable but could be invoked by `.call(...)` +// var v3a = c3(1); // Error. +// ^ +// +// pkg/front_end/testcases/records/issue54616.dart:14:13: Error: The 'call' property on the record type isn't directly callable but could be invoked by `.call(...)` +// var v3b = c3("a"); // Error. +// ^ +// +import self as self; +import "dart:core" as core; + +static method main() → void { + ({call: (core::int) → core::int}) c = ({call: (core::int x) → core::int => x}); + core::int v = c.call{(core::int) → core::int}(1){(core::int) → core::int}; + ({call: (core::int) → core::int}) c2 = #C2; + core::int v2 = c2.call{(core::int) → core::int}(1){(core::int) → core::int}; + ({call: (T%) → T%}) c3 = ({call: (T% x) → T% => x}); + core::int v3a = c3.call{(T%) → T%}(1){(core::int) → core::int}; + core::String v3b = c3.call{(T%) → T%}("a"){(core::String) → core::String}; +} +static method intId(core::int x) → core::int + return x; + +constants { + #C1 = static-tearoff self::intId + #C2 = ({call:#C1}) +} diff --git a/pkg/front_end/testcases/records/issue54616.dart.strong.transformed.expect b/pkg/front_end/testcases/records/issue54616.dart.strong.transformed.expect new file mode 100644 index 00000000000..6a26646020e --- /dev/null +++ b/pkg/front_end/testcases/records/issue54616.dart.strong.transformed.expect @@ -0,0 +1,39 @@ +library; +// +// Problems in library: +// +// pkg/front_end/testcases/records/issue54616.dart:7:11: Error: The 'call' property on the record type isn't directly callable but could be invoked by `.call(...)` +// var v = c(1); // Error. +// ^ +// +// pkg/front_end/testcases/records/issue54616.dart:10:12: Error: The 'call' property on the record type isn't directly callable but could be invoked by `.call(...)` +// var v2 = c2(1); // Error. +// ^ +// +// pkg/front_end/testcases/records/issue54616.dart:13:13: Error: The 'call' property on the record type isn't directly callable but could be invoked by `.call(...)` +// var v3a = c3(1); // Error. +// ^ +// +// pkg/front_end/testcases/records/issue54616.dart:14:13: Error: The 'call' property on the record type isn't directly callable but could be invoked by `.call(...)` +// var v3b = c3("a"); // Error. +// ^ +// +import self as self; +import "dart:core" as core; + +static method main() → void { + ({call: (core::int) → core::int}) c = ({call: (core::int x) → core::int => x}); + core::int v = c.call{(core::int) → core::int}(1){(core::int) → core::int}; + ({call: (core::int) → core::int}) c2 = #C2; + core::int v2 = c2.call{(core::int) → core::int}(1){(core::int) → core::int}; + ({call: (T%) → T%}) c3 = ({call: (T% x) → T% => x}); + core::int v3a = c3.call{(T%) → T%}(1){(core::int) → core::int}; + core::String v3b = c3.call{(T%) → T%}("a"){(core::String) → core::String}; +} +static method intId(core::int x) → core::int + return x; + +constants { + #C1 = static-tearoff self::intId + #C2 = ({call:#C1}) +} diff --git a/pkg/front_end/testcases/records/issue54616.dart.textual_outline.expect b/pkg/front_end/testcases/records/issue54616.dart.textual_outline.expect new file mode 100644 index 00000000000..a9d9f9debea --- /dev/null +++ b/pkg/front_end/testcases/records/issue54616.dart.textual_outline.expect @@ -0,0 +1,3 @@ +void main() {} + +int intId(int x) => x; diff --git a/pkg/front_end/testcases/records/issue54616.dart.textual_outline_modelled.expect b/pkg/front_end/testcases/records/issue54616.dart.textual_outline_modelled.expect new file mode 100644 index 00000000000..70dea349cb9 --- /dev/null +++ b/pkg/front_end/testcases/records/issue54616.dart.textual_outline_modelled.expect @@ -0,0 +1,3 @@ +int intId(int x) => x; + +void main() {} diff --git a/pkg/front_end/testcases/records/issue54616.dart.weak.expect b/pkg/front_end/testcases/records/issue54616.dart.weak.expect new file mode 100644 index 00000000000..6a26646020e --- /dev/null +++ b/pkg/front_end/testcases/records/issue54616.dart.weak.expect @@ -0,0 +1,39 @@ +library; +// +// Problems in library: +// +// pkg/front_end/testcases/records/issue54616.dart:7:11: Error: The 'call' property on the record type isn't directly callable but could be invoked by `.call(...)` +// var v = c(1); // Error. +// ^ +// +// pkg/front_end/testcases/records/issue54616.dart:10:12: Error: The 'call' property on the record type isn't directly callable but could be invoked by `.call(...)` +// var v2 = c2(1); // Error. +// ^ +// +// pkg/front_end/testcases/records/issue54616.dart:13:13: Error: The 'call' property on the record type isn't directly callable but could be invoked by `.call(...)` +// var v3a = c3(1); // Error. +// ^ +// +// pkg/front_end/testcases/records/issue54616.dart:14:13: Error: The 'call' property on the record type isn't directly callable but could be invoked by `.call(...)` +// var v3b = c3("a"); // Error. +// ^ +// +import self as self; +import "dart:core" as core; + +static method main() → void { + ({call: (core::int) → core::int}) c = ({call: (core::int x) → core::int => x}); + core::int v = c.call{(core::int) → core::int}(1){(core::int) → core::int}; + ({call: (core::int) → core::int}) c2 = #C2; + core::int v2 = c2.call{(core::int) → core::int}(1){(core::int) → core::int}; + ({call: (T%) → T%}) c3 = ({call: (T% x) → T% => x}); + core::int v3a = c3.call{(T%) → T%}(1){(core::int) → core::int}; + core::String v3b = c3.call{(T%) → T%}("a"){(core::String) → core::String}; +} +static method intId(core::int x) → core::int + return x; + +constants { + #C1 = static-tearoff self::intId + #C2 = ({call:#C1}) +} diff --git a/pkg/front_end/testcases/records/issue54616.dart.weak.modular.expect b/pkg/front_end/testcases/records/issue54616.dart.weak.modular.expect new file mode 100644 index 00000000000..6a26646020e --- /dev/null +++ b/pkg/front_end/testcases/records/issue54616.dart.weak.modular.expect @@ -0,0 +1,39 @@ +library; +// +// Problems in library: +// +// pkg/front_end/testcases/records/issue54616.dart:7:11: Error: The 'call' property on the record type isn't directly callable but could be invoked by `.call(...)` +// var v = c(1); // Error. +// ^ +// +// pkg/front_end/testcases/records/issue54616.dart:10:12: Error: The 'call' property on the record type isn't directly callable but could be invoked by `.call(...)` +// var v2 = c2(1); // Error. +// ^ +// +// pkg/front_end/testcases/records/issue54616.dart:13:13: Error: The 'call' property on the record type isn't directly callable but could be invoked by `.call(...)` +// var v3a = c3(1); // Error. +// ^ +// +// pkg/front_end/testcases/records/issue54616.dart:14:13: Error: The 'call' property on the record type isn't directly callable but could be invoked by `.call(...)` +// var v3b = c3("a"); // Error. +// ^ +// +import self as self; +import "dart:core" as core; + +static method main() → void { + ({call: (core::int) → core::int}) c = ({call: (core::int x) → core::int => x}); + core::int v = c.call{(core::int) → core::int}(1){(core::int) → core::int}; + ({call: (core::int) → core::int}) c2 = #C2; + core::int v2 = c2.call{(core::int) → core::int}(1){(core::int) → core::int}; + ({call: (T%) → T%}) c3 = ({call: (T% x) → T% => x}); + core::int v3a = c3.call{(T%) → T%}(1){(core::int) → core::int}; + core::String v3b = c3.call{(T%) → T%}("a"){(core::String) → core::String}; +} +static method intId(core::int x) → core::int + return x; + +constants { + #C1 = static-tearoff self::intId + #C2 = ({call:#C1}) +} diff --git a/pkg/front_end/testcases/records/issue54616.dart.weak.outline.expect b/pkg/front_end/testcases/records/issue54616.dart.weak.outline.expect new file mode 100644 index 00000000000..dcb2ce1770d --- /dev/null +++ b/pkg/front_end/testcases/records/issue54616.dart.weak.outline.expect @@ -0,0 +1,8 @@ +library; +import self as self; +import "dart:core" as core; + +static method main() → void + ; +static method intId(core::int x) → core::int + ; diff --git a/pkg/front_end/testcases/records/issue54616.dart.weak.transformed.expect b/pkg/front_end/testcases/records/issue54616.dart.weak.transformed.expect new file mode 100644 index 00000000000..6a26646020e --- /dev/null +++ b/pkg/front_end/testcases/records/issue54616.dart.weak.transformed.expect @@ -0,0 +1,39 @@ +library; +// +// Problems in library: +// +// pkg/front_end/testcases/records/issue54616.dart:7:11: Error: The 'call' property on the record type isn't directly callable but could be invoked by `.call(...)` +// var v = c(1); // Error. +// ^ +// +// pkg/front_end/testcases/records/issue54616.dart:10:12: Error: The 'call' property on the record type isn't directly callable but could be invoked by `.call(...)` +// var v2 = c2(1); // Error. +// ^ +// +// pkg/front_end/testcases/records/issue54616.dart:13:13: Error: The 'call' property on the record type isn't directly callable but could be invoked by `.call(...)` +// var v3a = c3(1); // Error. +// ^ +// +// pkg/front_end/testcases/records/issue54616.dart:14:13: Error: The 'call' property on the record type isn't directly callable but could be invoked by `.call(...)` +// var v3b = c3("a"); // Error. +// ^ +// +import self as self; +import "dart:core" as core; + +static method main() → void { + ({call: (core::int) → core::int}) c = ({call: (core::int x) → core::int => x}); + core::int v = c.call{(core::int) → core::int}(1){(core::int) → core::int}; + ({call: (core::int) → core::int}) c2 = #C2; + core::int v2 = c2.call{(core::int) → core::int}(1){(core::int) → core::int}; + ({call: (T%) → T%}) c3 = ({call: (T% x) → T% => x}); + core::int v3a = c3.call{(T%) → T%}(1){(core::int) → core::int}; + core::String v3b = c3.call{(T%) → T%}("a"){(core::String) → core::String}; +} +static method intId(core::int x) → core::int + return x; + +constants { + #C1 = static-tearoff self::intId + #C2 = ({call:#C1}) +} diff --git a/pkg/front_end/testcases/records/issue54616_2.dart b/pkg/front_end/testcases/records/issue54616_2.dart new file mode 100644 index 00000000000..16623f89a5f --- /dev/null +++ b/pkg/front_end/testcases/records/issue54616_2.dart @@ -0,0 +1,52 @@ +// Copyright (c) 2024, 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. + +extension EInt on (int,) { + dynamic call(dynamic x) => x; +} + +extension EIntIntCallInt on (int, int, {dynamic Function(dynamic) call}) { + dynamic call(dynamic x) => x; +} + +test( + (int,) r1, + (int, {dynamic Function(dynamic) call}) r2, + (int, int, {dynamic Function(dynamic) call}) r3, + (String,) r4, + X1 x1, + X2 x2, + X3 x3, + X4 x4, + X1? x1n, + X2? x2n, + X3? x3n, + X4? x4n) { + r1(0); // Ok. + r2(0); // Error. + r3(0); // Error. + r4(0); // Error. + r1.call(0); // Ok. + r2.call(0); // Ok. + r3.call(0); // Ok. + r4.call(0); // Error. + + x1(0); // Ok. + x2(0); // Error. + x3(0); // Error. + x4(0); // Error. + x1n(0); // Error. + x2n(0); // Error. + x3n(0); // Error. + x4n(0); // Error. + + x1.call(0); // Ok. + x2.call(0); // Ok. + x3.call(0); // Ok. + x4.call(0); // Error. + x1n.call(0); // Error. + x2n.call(0); // Error. + x3n.call(0); // Error. + x4n.call(0); // Error. +} diff --git a/pkg/front_end/testcases/records/issue54616_2.dart.strong.expect b/pkg/front_end/testcases/records/issue54616_2.dart.strong.expect new file mode 100644 index 00000000000..653cee2bb1c --- /dev/null +++ b/pkg/front_end/testcases/records/issue54616_2.dart.strong.expect @@ -0,0 +1,161 @@ +library; +// +// Problems in library: +// +// pkg/front_end/testcases/records/issue54616_2.dart:27:3: Error: The 'call' property on the record type isn't directly callable but could be invoked by `.call(...)` +// r2(0); // Error. +// ^ +// +// pkg/front_end/testcases/records/issue54616_2.dart:28:3: Error: The 'call' property on the record type isn't directly callable but could be invoked by `.call(...)` +// r3(0); // Error. +// ^ +// +// pkg/front_end/testcases/records/issue54616_2.dart:29:5: Error: The method 'call' isn't defined for the class '(String)'. +// Try correcting the name to the name of an existing method, or defining a method named 'call'. +// r4(0); // Error. +// ^ +// +// pkg/front_end/testcases/records/issue54616_2.dart:33:6: Error: The method 'call' isn't defined for the class '(String)'. +// Try correcting the name to the name of an existing method, or defining a method named 'call'. +// r4.call(0); // Error. +// ^^^^ +// +// pkg/front_end/testcases/records/issue54616_2.dart:36:3: Error: The 'call' property on the record type isn't directly callable but could be invoked by `.call(...)` +// x2(0); // Error. +// ^ +// +// pkg/front_end/testcases/records/issue54616_2.dart:37:3: Error: The 'call' property on the record type isn't directly callable but could be invoked by `.call(...)` +// x3(0); // Error. +// ^ +// +// pkg/front_end/testcases/records/issue54616_2.dart:38:5: Error: The method 'call' isn't defined for the class '(String)'. +// Try correcting the name to the name of an existing method, or defining a method named 'call'. +// x4(0); // Error. +// ^ +// +// pkg/front_end/testcases/records/issue54616_2.dart:39:6: Error: Can't use an expression of type 'X1?' as a function because it's potentially null. +// Try calling using ?.call instead. +// x1n(0); // Error. +// ^ +// +// pkg/front_end/testcases/records/issue54616_2.dart:40:6: Error: Can't use an expression of type 'X2?' as a function because it's potentially null. +// Try calling using ?.call instead. +// x2n(0); // Error. +// ^ +// +// pkg/front_end/testcases/records/issue54616_2.dart:41:6: Error: Can't use an expression of type 'X3?' as a function because it's potentially null. +// Try calling using ?.call instead. +// x3n(0); // Error. +// ^ +// +// pkg/front_end/testcases/records/issue54616_2.dart:42:6: Error: The method 'call' isn't defined for the class '(String)?'. +// Try correcting the name to the name of an existing method, or defining a method named 'call'. +// x4n(0); // Error. +// ^ +// +// pkg/front_end/testcases/records/issue54616_2.dart:47:6: Error: The method 'call' isn't defined for the class '(String)'. +// Try correcting the name to the name of an existing method, or defining a method named 'call'. +// x4.call(0); // Error. +// ^^^^ +// +// pkg/front_end/testcases/records/issue54616_2.dart:48:7: Error: Method 'call' cannot be called on 'X1?' because it is potentially null. +// Try calling using ?. instead. +// x1n.call(0); // Error. +// ^^^^ +// +// pkg/front_end/testcases/records/issue54616_2.dart:49:7: Error: Can't use an expression of type 'X2?' as a function because it's potentially null. +// Try calling using ?.call instead. +// x2n.call(0); // Error. +// ^ +// +// pkg/front_end/testcases/records/issue54616_2.dart:50:7: Error: Can't use an expression of type 'X3?' as a function because it's potentially null. +// Try calling using ?.call instead. +// x3n.call(0); // Error. +// ^ +// +// pkg/front_end/testcases/records/issue54616_2.dart:51:7: Error: The method 'call' isn't defined for the class '(String)?'. +// Try correcting the name to the name of an existing method, or defining a method named 'call'. +// x4n.call(0); // Error. +// ^^^^ +// +import self as self; +import "dart:core" as core; + +extension EInt on (core::int) { + method call = self::EInt|call; + method tearoff call = self::EInt|get#call; +} +extension EIntIntCallInt on (core::int, core::int, {required call: (dynamic) → dynamic}) { + method call = self::EIntIntCallInt|call; + method tearoff call = self::EIntIntCallInt|get#call; +} +static extension-member method EInt|call(lowered final(core::int) #this, dynamic x) → dynamic + return x; +static extension-member method EInt|get#call(lowered final(core::int) #this) → (dynamic) → dynamic + return (dynamic x) → dynamic => self::EInt|call(#this, x); +static extension-member method EIntIntCallInt|call(lowered final(core::int, core::int, {required call: (dynamic) → dynamic}) #this, dynamic x) → dynamic + return x; +static extension-member method EIntIntCallInt|get#call(lowered final(core::int, core::int, {required call: (dynamic) → dynamic}) #this) → (dynamic) → dynamic + return (dynamic x) → dynamic => self::EIntIntCallInt|call(#this, x); +static method test((core::int) r1, (core::int, {required call: (dynamic) → dynamic}) r2, (core::int, core::int, {required call: (dynamic) → dynamic}) r3, (core::String) r4, self::test::X1 x1, self::test::X2 x2, self::test::X3 x3, self::test::X4 x4, self::test::X1? x1n, self::test::X2? x2n, self::test::X3? x3n, self::test::X4? x4n) → dynamic { + self::EInt|call(r1, 0); + r2.call{(dynamic) → dynamic}(0){(dynamic) → dynamic}; + r3.call{(dynamic) → dynamic}(0){(dynamic) → dynamic}; + invalid-expression "pkg/front_end/testcases/records/issue54616_2.dart:29:5: Error: The method 'call' isn't defined for the class '(String)'. +Try correcting the name to the name of an existing method, or defining a method named 'call'. + r4(0); // Error. + ^" in r4{}.call(0); + self::EInt|call(r1, 0); + r2.call{(dynamic) → dynamic}(0){(dynamic) → dynamic}; + r3.call{(dynamic) → dynamic}(0){(dynamic) → dynamic}; + invalid-expression "pkg/front_end/testcases/records/issue54616_2.dart:33:6: Error: The method 'call' isn't defined for the class '(String)'. +Try correcting the name to the name of an existing method, or defining a method named 'call'. + r4.call(0); // Error. + ^^^^" in r4{}.call(0); + self::EInt|call(x1, 0); + x2.call{(dynamic) → dynamic}(0){(dynamic) → dynamic}; + x3.call{(dynamic) → dynamic}(0){(dynamic) → dynamic}; + invalid-expression "pkg/front_end/testcases/records/issue54616_2.dart:38:5: Error: The method 'call' isn't defined for the class '(String)'. +Try correcting the name to the name of an existing method, or defining a method named 'call'. + x4(0); // Error. + ^" in x4{}.call(0); + invalid-expression "pkg/front_end/testcases/records/issue54616_2.dart:39:6: Error: Can't use an expression of type 'X1?' as a function because it's potentially null. +Try calling using ?.call instead. + x1n(0); // Error. + ^" in self::EInt|call(x1n, 0); + invalid-expression "pkg/front_end/testcases/records/issue54616_2.dart:40:6: Error: Can't use an expression of type 'X2?' as a function because it's potentially null. +Try calling using ?.call instead. + x2n(0); // Error. + ^" in x2n.call{(dynamic) → dynamic}(0){(dynamic) → dynamic}; + invalid-expression "pkg/front_end/testcases/records/issue54616_2.dart:41:6: Error: Can't use an expression of type 'X3?' as a function because it's potentially null. +Try calling using ?.call instead. + x3n(0); // Error. + ^" in x3n.call{(dynamic) → dynamic}(0){(dynamic) → dynamic}; + invalid-expression "pkg/front_end/testcases/records/issue54616_2.dart:42:6: Error: The method 'call' isn't defined for the class '(String)?'. +Try correcting the name to the name of an existing method, or defining a method named 'call'. + x4n(0); // Error. + ^" in x4n{}.call(0); + self::EInt|call(x1, 0); + x2.call{(dynamic) → dynamic}(0){(dynamic) → dynamic}; + x3.call{(dynamic) → dynamic}(0){(dynamic) → dynamic}; + invalid-expression "pkg/front_end/testcases/records/issue54616_2.dart:47:6: Error: The method 'call' isn't defined for the class '(String)'. +Try correcting the name to the name of an existing method, or defining a method named 'call'. + x4.call(0); // Error. + ^^^^" in x4{}.call(0); + invalid-expression "pkg/front_end/testcases/records/issue54616_2.dart:48:7: Error: Method 'call' cannot be called on 'X1?' because it is potentially null. +Try calling using ?. instead. + x1n.call(0); // Error. + ^^^^" in self::EInt|call(x1n, 0); + invalid-expression "pkg/front_end/testcases/records/issue54616_2.dart:49:7: Error: Can't use an expression of type 'X2?' as a function because it's potentially null. +Try calling using ?.call instead. + x2n.call(0); // Error. + ^" in x2n.call{(dynamic) → dynamic}(0){(dynamic) → dynamic}; + invalid-expression "pkg/front_end/testcases/records/issue54616_2.dart:50:7: Error: Can't use an expression of type 'X3?' as a function because it's potentially null. +Try calling using ?.call instead. + x3n.call(0); // Error. + ^" in x3n.call{(dynamic) → dynamic}(0){(dynamic) → dynamic}; + invalid-expression "pkg/front_end/testcases/records/issue54616_2.dart:51:7: Error: The method 'call' isn't defined for the class '(String)?'. +Try correcting the name to the name of an existing method, or defining a method named 'call'. + x4n.call(0); // Error. + ^^^^" in x4n{}.call(0); +} diff --git a/pkg/front_end/testcases/records/issue54616_2.dart.strong.transformed.expect b/pkg/front_end/testcases/records/issue54616_2.dart.strong.transformed.expect new file mode 100644 index 00000000000..653cee2bb1c --- /dev/null +++ b/pkg/front_end/testcases/records/issue54616_2.dart.strong.transformed.expect @@ -0,0 +1,161 @@ +library; +// +// Problems in library: +// +// pkg/front_end/testcases/records/issue54616_2.dart:27:3: Error: The 'call' property on the record type isn't directly callable but could be invoked by `.call(...)` +// r2(0); // Error. +// ^ +// +// pkg/front_end/testcases/records/issue54616_2.dart:28:3: Error: The 'call' property on the record type isn't directly callable but could be invoked by `.call(...)` +// r3(0); // Error. +// ^ +// +// pkg/front_end/testcases/records/issue54616_2.dart:29:5: Error: The method 'call' isn't defined for the class '(String)'. +// Try correcting the name to the name of an existing method, or defining a method named 'call'. +// r4(0); // Error. +// ^ +// +// pkg/front_end/testcases/records/issue54616_2.dart:33:6: Error: The method 'call' isn't defined for the class '(String)'. +// Try correcting the name to the name of an existing method, or defining a method named 'call'. +// r4.call(0); // Error. +// ^^^^ +// +// pkg/front_end/testcases/records/issue54616_2.dart:36:3: Error: The 'call' property on the record type isn't directly callable but could be invoked by `.call(...)` +// x2(0); // Error. +// ^ +// +// pkg/front_end/testcases/records/issue54616_2.dart:37:3: Error: The 'call' property on the record type isn't directly callable but could be invoked by `.call(...)` +// x3(0); // Error. +// ^ +// +// pkg/front_end/testcases/records/issue54616_2.dart:38:5: Error: The method 'call' isn't defined for the class '(String)'. +// Try correcting the name to the name of an existing method, or defining a method named 'call'. +// x4(0); // Error. +// ^ +// +// pkg/front_end/testcases/records/issue54616_2.dart:39:6: Error: Can't use an expression of type 'X1?' as a function because it's potentially null. +// Try calling using ?.call instead. +// x1n(0); // Error. +// ^ +// +// pkg/front_end/testcases/records/issue54616_2.dart:40:6: Error: Can't use an expression of type 'X2?' as a function because it's potentially null. +// Try calling using ?.call instead. +// x2n(0); // Error. +// ^ +// +// pkg/front_end/testcases/records/issue54616_2.dart:41:6: Error: Can't use an expression of type 'X3?' as a function because it's potentially null. +// Try calling using ?.call instead. +// x3n(0); // Error. +// ^ +// +// pkg/front_end/testcases/records/issue54616_2.dart:42:6: Error: The method 'call' isn't defined for the class '(String)?'. +// Try correcting the name to the name of an existing method, or defining a method named 'call'. +// x4n(0); // Error. +// ^ +// +// pkg/front_end/testcases/records/issue54616_2.dart:47:6: Error: The method 'call' isn't defined for the class '(String)'. +// Try correcting the name to the name of an existing method, or defining a method named 'call'. +// x4.call(0); // Error. +// ^^^^ +// +// pkg/front_end/testcases/records/issue54616_2.dart:48:7: Error: Method 'call' cannot be called on 'X1?' because it is potentially null. +// Try calling using ?. instead. +// x1n.call(0); // Error. +// ^^^^ +// +// pkg/front_end/testcases/records/issue54616_2.dart:49:7: Error: Can't use an expression of type 'X2?' as a function because it's potentially null. +// Try calling using ?.call instead. +// x2n.call(0); // Error. +// ^ +// +// pkg/front_end/testcases/records/issue54616_2.dart:50:7: Error: Can't use an expression of type 'X3?' as a function because it's potentially null. +// Try calling using ?.call instead. +// x3n.call(0); // Error. +// ^ +// +// pkg/front_end/testcases/records/issue54616_2.dart:51:7: Error: The method 'call' isn't defined for the class '(String)?'. +// Try correcting the name to the name of an existing method, or defining a method named 'call'. +// x4n.call(0); // Error. +// ^^^^ +// +import self as self; +import "dart:core" as core; + +extension EInt on (core::int) { + method call = self::EInt|call; + method tearoff call = self::EInt|get#call; +} +extension EIntIntCallInt on (core::int, core::int, {required call: (dynamic) → dynamic}) { + method call = self::EIntIntCallInt|call; + method tearoff call = self::EIntIntCallInt|get#call; +} +static extension-member method EInt|call(lowered final(core::int) #this, dynamic x) → dynamic + return x; +static extension-member method EInt|get#call(lowered final(core::int) #this) → (dynamic) → dynamic + return (dynamic x) → dynamic => self::EInt|call(#this, x); +static extension-member method EIntIntCallInt|call(lowered final(core::int, core::int, {required call: (dynamic) → dynamic}) #this, dynamic x) → dynamic + return x; +static extension-member method EIntIntCallInt|get#call(lowered final(core::int, core::int, {required call: (dynamic) → dynamic}) #this) → (dynamic) → dynamic + return (dynamic x) → dynamic => self::EIntIntCallInt|call(#this, x); +static method test((core::int) r1, (core::int, {required call: (dynamic) → dynamic}) r2, (core::int, core::int, {required call: (dynamic) → dynamic}) r3, (core::String) r4, self::test::X1 x1, self::test::X2 x2, self::test::X3 x3, self::test::X4 x4, self::test::X1? x1n, self::test::X2? x2n, self::test::X3? x3n, self::test::X4? x4n) → dynamic { + self::EInt|call(r1, 0); + r2.call{(dynamic) → dynamic}(0){(dynamic) → dynamic}; + r3.call{(dynamic) → dynamic}(0){(dynamic) → dynamic}; + invalid-expression "pkg/front_end/testcases/records/issue54616_2.dart:29:5: Error: The method 'call' isn't defined for the class '(String)'. +Try correcting the name to the name of an existing method, or defining a method named 'call'. + r4(0); // Error. + ^" in r4{}.call(0); + self::EInt|call(r1, 0); + r2.call{(dynamic) → dynamic}(0){(dynamic) → dynamic}; + r3.call{(dynamic) → dynamic}(0){(dynamic) → dynamic}; + invalid-expression "pkg/front_end/testcases/records/issue54616_2.dart:33:6: Error: The method 'call' isn't defined for the class '(String)'. +Try correcting the name to the name of an existing method, or defining a method named 'call'. + r4.call(0); // Error. + ^^^^" in r4{}.call(0); + self::EInt|call(x1, 0); + x2.call{(dynamic) → dynamic}(0){(dynamic) → dynamic}; + x3.call{(dynamic) → dynamic}(0){(dynamic) → dynamic}; + invalid-expression "pkg/front_end/testcases/records/issue54616_2.dart:38:5: Error: The method 'call' isn't defined for the class '(String)'. +Try correcting the name to the name of an existing method, or defining a method named 'call'. + x4(0); // Error. + ^" in x4{}.call(0); + invalid-expression "pkg/front_end/testcases/records/issue54616_2.dart:39:6: Error: Can't use an expression of type 'X1?' as a function because it's potentially null. +Try calling using ?.call instead. + x1n(0); // Error. + ^" in self::EInt|call(x1n, 0); + invalid-expression "pkg/front_end/testcases/records/issue54616_2.dart:40:6: Error: Can't use an expression of type 'X2?' as a function because it's potentially null. +Try calling using ?.call instead. + x2n(0); // Error. + ^" in x2n.call{(dynamic) → dynamic}(0){(dynamic) → dynamic}; + invalid-expression "pkg/front_end/testcases/records/issue54616_2.dart:41:6: Error: Can't use an expression of type 'X3?' as a function because it's potentially null. +Try calling using ?.call instead. + x3n(0); // Error. + ^" in x3n.call{(dynamic) → dynamic}(0){(dynamic) → dynamic}; + invalid-expression "pkg/front_end/testcases/records/issue54616_2.dart:42:6: Error: The method 'call' isn't defined for the class '(String)?'. +Try correcting the name to the name of an existing method, or defining a method named 'call'. + x4n(0); // Error. + ^" in x4n{}.call(0); + self::EInt|call(x1, 0); + x2.call{(dynamic) → dynamic}(0){(dynamic) → dynamic}; + x3.call{(dynamic) → dynamic}(0){(dynamic) → dynamic}; + invalid-expression "pkg/front_end/testcases/records/issue54616_2.dart:47:6: Error: The method 'call' isn't defined for the class '(String)'. +Try correcting the name to the name of an existing method, or defining a method named 'call'. + x4.call(0); // Error. + ^^^^" in x4{}.call(0); + invalid-expression "pkg/front_end/testcases/records/issue54616_2.dart:48:7: Error: Method 'call' cannot be called on 'X1?' because it is potentially null. +Try calling using ?. instead. + x1n.call(0); // Error. + ^^^^" in self::EInt|call(x1n, 0); + invalid-expression "pkg/front_end/testcases/records/issue54616_2.dart:49:7: Error: Can't use an expression of type 'X2?' as a function because it's potentially null. +Try calling using ?.call instead. + x2n.call(0); // Error. + ^" in x2n.call{(dynamic) → dynamic}(0){(dynamic) → dynamic}; + invalid-expression "pkg/front_end/testcases/records/issue54616_2.dart:50:7: Error: Can't use an expression of type 'X3?' as a function because it's potentially null. +Try calling using ?.call instead. + x3n.call(0); // Error. + ^" in x3n.call{(dynamic) → dynamic}(0){(dynamic) → dynamic}; + invalid-expression "pkg/front_end/testcases/records/issue54616_2.dart:51:7: Error: The method 'call' isn't defined for the class '(String)?'. +Try correcting the name to the name of an existing method, or defining a method named 'call'. + x4n.call(0); // Error. + ^^^^" in x4n{}.call(0); +} diff --git a/pkg/front_end/testcases/records/issue54616_2.dart.textual_outline.expect b/pkg/front_end/testcases/records/issue54616_2.dart.textual_outline.expect new file mode 100644 index 00000000000..af151bf89e7 --- /dev/null +++ b/pkg/front_end/testcases/records/issue54616_2.dart.textual_outline.expect @@ -0,0 +1,25 @@ +extension EInt on (int,) { + dynamic call(dynamic x) => x; +} + +extension EIntIntCallInt on (int, int, {dynamic Function(dynamic) call}) { + dynamic call(dynamic x) => x; +} + +test< + X1 extends (int,), + X2 extends (int, {dynamic Function(dynamic) call}), + X3 extends (int, int, {dynamic Function(dynamic) call}), + X4 extends (String,)>( + (int,) r1, + (int, {dynamic Function(dynamic) call}) r2, + (int, int, {dynamic Function(dynamic) call}) r3, + (String,) r4, + X1 x1, + X2 x2, + X3 x3, + X4 x4, + X1? x1n, + X2? x2n, + X3? x3n, + X4? x4n) {} diff --git a/pkg/front_end/testcases/records/issue54616_2.dart.textual_outline_modelled.expect b/pkg/front_end/testcases/records/issue54616_2.dart.textual_outline_modelled.expect new file mode 100644 index 00000000000..af151bf89e7 --- /dev/null +++ b/pkg/front_end/testcases/records/issue54616_2.dart.textual_outline_modelled.expect @@ -0,0 +1,25 @@ +extension EInt on (int,) { + dynamic call(dynamic x) => x; +} + +extension EIntIntCallInt on (int, int, {dynamic Function(dynamic) call}) { + dynamic call(dynamic x) => x; +} + +test< + X1 extends (int,), + X2 extends (int, {dynamic Function(dynamic) call}), + X3 extends (int, int, {dynamic Function(dynamic) call}), + X4 extends (String,)>( + (int,) r1, + (int, {dynamic Function(dynamic) call}) r2, + (int, int, {dynamic Function(dynamic) call}) r3, + (String,) r4, + X1 x1, + X2 x2, + X3 x3, + X4 x4, + X1? x1n, + X2? x2n, + X3? x3n, + X4? x4n) {} diff --git a/pkg/front_end/testcases/records/issue54616_2.dart.weak.expect b/pkg/front_end/testcases/records/issue54616_2.dart.weak.expect new file mode 100644 index 00000000000..653cee2bb1c --- /dev/null +++ b/pkg/front_end/testcases/records/issue54616_2.dart.weak.expect @@ -0,0 +1,161 @@ +library; +// +// Problems in library: +// +// pkg/front_end/testcases/records/issue54616_2.dart:27:3: Error: The 'call' property on the record type isn't directly callable but could be invoked by `.call(...)` +// r2(0); // Error. +// ^ +// +// pkg/front_end/testcases/records/issue54616_2.dart:28:3: Error: The 'call' property on the record type isn't directly callable but could be invoked by `.call(...)` +// r3(0); // Error. +// ^ +// +// pkg/front_end/testcases/records/issue54616_2.dart:29:5: Error: The method 'call' isn't defined for the class '(String)'. +// Try correcting the name to the name of an existing method, or defining a method named 'call'. +// r4(0); // Error. +// ^ +// +// pkg/front_end/testcases/records/issue54616_2.dart:33:6: Error: The method 'call' isn't defined for the class '(String)'. +// Try correcting the name to the name of an existing method, or defining a method named 'call'. +// r4.call(0); // Error. +// ^^^^ +// +// pkg/front_end/testcases/records/issue54616_2.dart:36:3: Error: The 'call' property on the record type isn't directly callable but could be invoked by `.call(...)` +// x2(0); // Error. +// ^ +// +// pkg/front_end/testcases/records/issue54616_2.dart:37:3: Error: The 'call' property on the record type isn't directly callable but could be invoked by `.call(...)` +// x3(0); // Error. +// ^ +// +// pkg/front_end/testcases/records/issue54616_2.dart:38:5: Error: The method 'call' isn't defined for the class '(String)'. +// Try correcting the name to the name of an existing method, or defining a method named 'call'. +// x4(0); // Error. +// ^ +// +// pkg/front_end/testcases/records/issue54616_2.dart:39:6: Error: Can't use an expression of type 'X1?' as a function because it's potentially null. +// Try calling using ?.call instead. +// x1n(0); // Error. +// ^ +// +// pkg/front_end/testcases/records/issue54616_2.dart:40:6: Error: Can't use an expression of type 'X2?' as a function because it's potentially null. +// Try calling using ?.call instead. +// x2n(0); // Error. +// ^ +// +// pkg/front_end/testcases/records/issue54616_2.dart:41:6: Error: Can't use an expression of type 'X3?' as a function because it's potentially null. +// Try calling using ?.call instead. +// x3n(0); // Error. +// ^ +// +// pkg/front_end/testcases/records/issue54616_2.dart:42:6: Error: The method 'call' isn't defined for the class '(String)?'. +// Try correcting the name to the name of an existing method, or defining a method named 'call'. +// x4n(0); // Error. +// ^ +// +// pkg/front_end/testcases/records/issue54616_2.dart:47:6: Error: The method 'call' isn't defined for the class '(String)'. +// Try correcting the name to the name of an existing method, or defining a method named 'call'. +// x4.call(0); // Error. +// ^^^^ +// +// pkg/front_end/testcases/records/issue54616_2.dart:48:7: Error: Method 'call' cannot be called on 'X1?' because it is potentially null. +// Try calling using ?. instead. +// x1n.call(0); // Error. +// ^^^^ +// +// pkg/front_end/testcases/records/issue54616_2.dart:49:7: Error: Can't use an expression of type 'X2?' as a function because it's potentially null. +// Try calling using ?.call instead. +// x2n.call(0); // Error. +// ^ +// +// pkg/front_end/testcases/records/issue54616_2.dart:50:7: Error: Can't use an expression of type 'X3?' as a function because it's potentially null. +// Try calling using ?.call instead. +// x3n.call(0); // Error. +// ^ +// +// pkg/front_end/testcases/records/issue54616_2.dart:51:7: Error: The method 'call' isn't defined for the class '(String)?'. +// Try correcting the name to the name of an existing method, or defining a method named 'call'. +// x4n.call(0); // Error. +// ^^^^ +// +import self as self; +import "dart:core" as core; + +extension EInt on (core::int) { + method call = self::EInt|call; + method tearoff call = self::EInt|get#call; +} +extension EIntIntCallInt on (core::int, core::int, {required call: (dynamic) → dynamic}) { + method call = self::EIntIntCallInt|call; + method tearoff call = self::EIntIntCallInt|get#call; +} +static extension-member method EInt|call(lowered final(core::int) #this, dynamic x) → dynamic + return x; +static extension-member method EInt|get#call(lowered final(core::int) #this) → (dynamic) → dynamic + return (dynamic x) → dynamic => self::EInt|call(#this, x); +static extension-member method EIntIntCallInt|call(lowered final(core::int, core::int, {required call: (dynamic) → dynamic}) #this, dynamic x) → dynamic + return x; +static extension-member method EIntIntCallInt|get#call(lowered final(core::int, core::int, {required call: (dynamic) → dynamic}) #this) → (dynamic) → dynamic + return (dynamic x) → dynamic => self::EIntIntCallInt|call(#this, x); +static method test((core::int) r1, (core::int, {required call: (dynamic) → dynamic}) r2, (core::int, core::int, {required call: (dynamic) → dynamic}) r3, (core::String) r4, self::test::X1 x1, self::test::X2 x2, self::test::X3 x3, self::test::X4 x4, self::test::X1? x1n, self::test::X2? x2n, self::test::X3? x3n, self::test::X4? x4n) → dynamic { + self::EInt|call(r1, 0); + r2.call{(dynamic) → dynamic}(0){(dynamic) → dynamic}; + r3.call{(dynamic) → dynamic}(0){(dynamic) → dynamic}; + invalid-expression "pkg/front_end/testcases/records/issue54616_2.dart:29:5: Error: The method 'call' isn't defined for the class '(String)'. +Try correcting the name to the name of an existing method, or defining a method named 'call'. + r4(0); // Error. + ^" in r4{}.call(0); + self::EInt|call(r1, 0); + r2.call{(dynamic) → dynamic}(0){(dynamic) → dynamic}; + r3.call{(dynamic) → dynamic}(0){(dynamic) → dynamic}; + invalid-expression "pkg/front_end/testcases/records/issue54616_2.dart:33:6: Error: The method 'call' isn't defined for the class '(String)'. +Try correcting the name to the name of an existing method, or defining a method named 'call'. + r4.call(0); // Error. + ^^^^" in r4{}.call(0); + self::EInt|call(x1, 0); + x2.call{(dynamic) → dynamic}(0){(dynamic) → dynamic}; + x3.call{(dynamic) → dynamic}(0){(dynamic) → dynamic}; + invalid-expression "pkg/front_end/testcases/records/issue54616_2.dart:38:5: Error: The method 'call' isn't defined for the class '(String)'. +Try correcting the name to the name of an existing method, or defining a method named 'call'. + x4(0); // Error. + ^" in x4{}.call(0); + invalid-expression "pkg/front_end/testcases/records/issue54616_2.dart:39:6: Error: Can't use an expression of type 'X1?' as a function because it's potentially null. +Try calling using ?.call instead. + x1n(0); // Error. + ^" in self::EInt|call(x1n, 0); + invalid-expression "pkg/front_end/testcases/records/issue54616_2.dart:40:6: Error: Can't use an expression of type 'X2?' as a function because it's potentially null. +Try calling using ?.call instead. + x2n(0); // Error. + ^" in x2n.call{(dynamic) → dynamic}(0){(dynamic) → dynamic}; + invalid-expression "pkg/front_end/testcases/records/issue54616_2.dart:41:6: Error: Can't use an expression of type 'X3?' as a function because it's potentially null. +Try calling using ?.call instead. + x3n(0); // Error. + ^" in x3n.call{(dynamic) → dynamic}(0){(dynamic) → dynamic}; + invalid-expression "pkg/front_end/testcases/records/issue54616_2.dart:42:6: Error: The method 'call' isn't defined for the class '(String)?'. +Try correcting the name to the name of an existing method, or defining a method named 'call'. + x4n(0); // Error. + ^" in x4n{}.call(0); + self::EInt|call(x1, 0); + x2.call{(dynamic) → dynamic}(0){(dynamic) → dynamic}; + x3.call{(dynamic) → dynamic}(0){(dynamic) → dynamic}; + invalid-expression "pkg/front_end/testcases/records/issue54616_2.dart:47:6: Error: The method 'call' isn't defined for the class '(String)'. +Try correcting the name to the name of an existing method, or defining a method named 'call'. + x4.call(0); // Error. + ^^^^" in x4{}.call(0); + invalid-expression "pkg/front_end/testcases/records/issue54616_2.dart:48:7: Error: Method 'call' cannot be called on 'X1?' because it is potentially null. +Try calling using ?. instead. + x1n.call(0); // Error. + ^^^^" in self::EInt|call(x1n, 0); + invalid-expression "pkg/front_end/testcases/records/issue54616_2.dart:49:7: Error: Can't use an expression of type 'X2?' as a function because it's potentially null. +Try calling using ?.call instead. + x2n.call(0); // Error. + ^" in x2n.call{(dynamic) → dynamic}(0){(dynamic) → dynamic}; + invalid-expression "pkg/front_end/testcases/records/issue54616_2.dart:50:7: Error: Can't use an expression of type 'X3?' as a function because it's potentially null. +Try calling using ?.call instead. + x3n.call(0); // Error. + ^" in x3n.call{(dynamic) → dynamic}(0){(dynamic) → dynamic}; + invalid-expression "pkg/front_end/testcases/records/issue54616_2.dart:51:7: Error: The method 'call' isn't defined for the class '(String)?'. +Try correcting the name to the name of an existing method, or defining a method named 'call'. + x4n.call(0); // Error. + ^^^^" in x4n{}.call(0); +} diff --git a/pkg/front_end/testcases/records/issue54616_2.dart.weak.modular.expect b/pkg/front_end/testcases/records/issue54616_2.dart.weak.modular.expect new file mode 100644 index 00000000000..653cee2bb1c --- /dev/null +++ b/pkg/front_end/testcases/records/issue54616_2.dart.weak.modular.expect @@ -0,0 +1,161 @@ +library; +// +// Problems in library: +// +// pkg/front_end/testcases/records/issue54616_2.dart:27:3: Error: The 'call' property on the record type isn't directly callable but could be invoked by `.call(...)` +// r2(0); // Error. +// ^ +// +// pkg/front_end/testcases/records/issue54616_2.dart:28:3: Error: The 'call' property on the record type isn't directly callable but could be invoked by `.call(...)` +// r3(0); // Error. +// ^ +// +// pkg/front_end/testcases/records/issue54616_2.dart:29:5: Error: The method 'call' isn't defined for the class '(String)'. +// Try correcting the name to the name of an existing method, or defining a method named 'call'. +// r4(0); // Error. +// ^ +// +// pkg/front_end/testcases/records/issue54616_2.dart:33:6: Error: The method 'call' isn't defined for the class '(String)'. +// Try correcting the name to the name of an existing method, or defining a method named 'call'. +// r4.call(0); // Error. +// ^^^^ +// +// pkg/front_end/testcases/records/issue54616_2.dart:36:3: Error: The 'call' property on the record type isn't directly callable but could be invoked by `.call(...)` +// x2(0); // Error. +// ^ +// +// pkg/front_end/testcases/records/issue54616_2.dart:37:3: Error: The 'call' property on the record type isn't directly callable but could be invoked by `.call(...)` +// x3(0); // Error. +// ^ +// +// pkg/front_end/testcases/records/issue54616_2.dart:38:5: Error: The method 'call' isn't defined for the class '(String)'. +// Try correcting the name to the name of an existing method, or defining a method named 'call'. +// x4(0); // Error. +// ^ +// +// pkg/front_end/testcases/records/issue54616_2.dart:39:6: Error: Can't use an expression of type 'X1?' as a function because it's potentially null. +// Try calling using ?.call instead. +// x1n(0); // Error. +// ^ +// +// pkg/front_end/testcases/records/issue54616_2.dart:40:6: Error: Can't use an expression of type 'X2?' as a function because it's potentially null. +// Try calling using ?.call instead. +// x2n(0); // Error. +// ^ +// +// pkg/front_end/testcases/records/issue54616_2.dart:41:6: Error: Can't use an expression of type 'X3?' as a function because it's potentially null. +// Try calling using ?.call instead. +// x3n(0); // Error. +// ^ +// +// pkg/front_end/testcases/records/issue54616_2.dart:42:6: Error: The method 'call' isn't defined for the class '(String)?'. +// Try correcting the name to the name of an existing method, or defining a method named 'call'. +// x4n(0); // Error. +// ^ +// +// pkg/front_end/testcases/records/issue54616_2.dart:47:6: Error: The method 'call' isn't defined for the class '(String)'. +// Try correcting the name to the name of an existing method, or defining a method named 'call'. +// x4.call(0); // Error. +// ^^^^ +// +// pkg/front_end/testcases/records/issue54616_2.dart:48:7: Error: Method 'call' cannot be called on 'X1?' because it is potentially null. +// Try calling using ?. instead. +// x1n.call(0); // Error. +// ^^^^ +// +// pkg/front_end/testcases/records/issue54616_2.dart:49:7: Error: Can't use an expression of type 'X2?' as a function because it's potentially null. +// Try calling using ?.call instead. +// x2n.call(0); // Error. +// ^ +// +// pkg/front_end/testcases/records/issue54616_2.dart:50:7: Error: Can't use an expression of type 'X3?' as a function because it's potentially null. +// Try calling using ?.call instead. +// x3n.call(0); // Error. +// ^ +// +// pkg/front_end/testcases/records/issue54616_2.dart:51:7: Error: The method 'call' isn't defined for the class '(String)?'. +// Try correcting the name to the name of an existing method, or defining a method named 'call'. +// x4n.call(0); // Error. +// ^^^^ +// +import self as self; +import "dart:core" as core; + +extension EInt on (core::int) { + method call = self::EInt|call; + method tearoff call = self::EInt|get#call; +} +extension EIntIntCallInt on (core::int, core::int, {required call: (dynamic) → dynamic}) { + method call = self::EIntIntCallInt|call; + method tearoff call = self::EIntIntCallInt|get#call; +} +static extension-member method EInt|call(lowered final(core::int) #this, dynamic x) → dynamic + return x; +static extension-member method EInt|get#call(lowered final(core::int) #this) → (dynamic) → dynamic + return (dynamic x) → dynamic => self::EInt|call(#this, x); +static extension-member method EIntIntCallInt|call(lowered final(core::int, core::int, {required call: (dynamic) → dynamic}) #this, dynamic x) → dynamic + return x; +static extension-member method EIntIntCallInt|get#call(lowered final(core::int, core::int, {required call: (dynamic) → dynamic}) #this) → (dynamic) → dynamic + return (dynamic x) → dynamic => self::EIntIntCallInt|call(#this, x); +static method test((core::int) r1, (core::int, {required call: (dynamic) → dynamic}) r2, (core::int, core::int, {required call: (dynamic) → dynamic}) r3, (core::String) r4, self::test::X1 x1, self::test::X2 x2, self::test::X3 x3, self::test::X4 x4, self::test::X1? x1n, self::test::X2? x2n, self::test::X3? x3n, self::test::X4? x4n) → dynamic { + self::EInt|call(r1, 0); + r2.call{(dynamic) → dynamic}(0){(dynamic) → dynamic}; + r3.call{(dynamic) → dynamic}(0){(dynamic) → dynamic}; + invalid-expression "pkg/front_end/testcases/records/issue54616_2.dart:29:5: Error: The method 'call' isn't defined for the class '(String)'. +Try correcting the name to the name of an existing method, or defining a method named 'call'. + r4(0); // Error. + ^" in r4{}.call(0); + self::EInt|call(r1, 0); + r2.call{(dynamic) → dynamic}(0){(dynamic) → dynamic}; + r3.call{(dynamic) → dynamic}(0){(dynamic) → dynamic}; + invalid-expression "pkg/front_end/testcases/records/issue54616_2.dart:33:6: Error: The method 'call' isn't defined for the class '(String)'. +Try correcting the name to the name of an existing method, or defining a method named 'call'. + r4.call(0); // Error. + ^^^^" in r4{}.call(0); + self::EInt|call(x1, 0); + x2.call{(dynamic) → dynamic}(0){(dynamic) → dynamic}; + x3.call{(dynamic) → dynamic}(0){(dynamic) → dynamic}; + invalid-expression "pkg/front_end/testcases/records/issue54616_2.dart:38:5: Error: The method 'call' isn't defined for the class '(String)'. +Try correcting the name to the name of an existing method, or defining a method named 'call'. + x4(0); // Error. + ^" in x4{}.call(0); + invalid-expression "pkg/front_end/testcases/records/issue54616_2.dart:39:6: Error: Can't use an expression of type 'X1?' as a function because it's potentially null. +Try calling using ?.call instead. + x1n(0); // Error. + ^" in self::EInt|call(x1n, 0); + invalid-expression "pkg/front_end/testcases/records/issue54616_2.dart:40:6: Error: Can't use an expression of type 'X2?' as a function because it's potentially null. +Try calling using ?.call instead. + x2n(0); // Error. + ^" in x2n.call{(dynamic) → dynamic}(0){(dynamic) → dynamic}; + invalid-expression "pkg/front_end/testcases/records/issue54616_2.dart:41:6: Error: Can't use an expression of type 'X3?' as a function because it's potentially null. +Try calling using ?.call instead. + x3n(0); // Error. + ^" in x3n.call{(dynamic) → dynamic}(0){(dynamic) → dynamic}; + invalid-expression "pkg/front_end/testcases/records/issue54616_2.dart:42:6: Error: The method 'call' isn't defined for the class '(String)?'. +Try correcting the name to the name of an existing method, or defining a method named 'call'. + x4n(0); // Error. + ^" in x4n{}.call(0); + self::EInt|call(x1, 0); + x2.call{(dynamic) → dynamic}(0){(dynamic) → dynamic}; + x3.call{(dynamic) → dynamic}(0){(dynamic) → dynamic}; + invalid-expression "pkg/front_end/testcases/records/issue54616_2.dart:47:6: Error: The method 'call' isn't defined for the class '(String)'. +Try correcting the name to the name of an existing method, or defining a method named 'call'. + x4.call(0); // Error. + ^^^^" in x4{}.call(0); + invalid-expression "pkg/front_end/testcases/records/issue54616_2.dart:48:7: Error: Method 'call' cannot be called on 'X1?' because it is potentially null. +Try calling using ?. instead. + x1n.call(0); // Error. + ^^^^" in self::EInt|call(x1n, 0); + invalid-expression "pkg/front_end/testcases/records/issue54616_2.dart:49:7: Error: Can't use an expression of type 'X2?' as a function because it's potentially null. +Try calling using ?.call instead. + x2n.call(0); // Error. + ^" in x2n.call{(dynamic) → dynamic}(0){(dynamic) → dynamic}; + invalid-expression "pkg/front_end/testcases/records/issue54616_2.dart:50:7: Error: Can't use an expression of type 'X3?' as a function because it's potentially null. +Try calling using ?.call instead. + x3n.call(0); // Error. + ^" in x3n.call{(dynamic) → dynamic}(0){(dynamic) → dynamic}; + invalid-expression "pkg/front_end/testcases/records/issue54616_2.dart:51:7: Error: The method 'call' isn't defined for the class '(String)?'. +Try correcting the name to the name of an existing method, or defining a method named 'call'. + x4n.call(0); // Error. + ^^^^" in x4n{}.call(0); +} diff --git a/pkg/front_end/testcases/records/issue54616_2.dart.weak.outline.expect b/pkg/front_end/testcases/records/issue54616_2.dart.weak.outline.expect new file mode 100644 index 00000000000..317d8aba23d --- /dev/null +++ b/pkg/front_end/testcases/records/issue54616_2.dart.weak.outline.expect @@ -0,0 +1,22 @@ +library; +import self as self; +import "dart:core" as core; + +extension EInt on (core::int) { + method call = self::EInt|call; + method tearoff call = self::EInt|get#call; +} +extension EIntIntCallInt on (core::int, core::int, {required call: (dynamic) → dynamic}) { + method call = self::EIntIntCallInt|call; + method tearoff call = self::EIntIntCallInt|get#call; +} +static extension-member method EInt|call(lowered final(core::int) #this, dynamic x) → dynamic + ; +static extension-member method EInt|get#call(lowered final(core::int) #this) → (dynamic) → dynamic + return (dynamic x) → dynamic => self::EInt|call(#this, x); +static extension-member method EIntIntCallInt|call(lowered final(core::int, core::int, {required call: (dynamic) → dynamic}) #this, dynamic x) → dynamic + ; +static extension-member method EIntIntCallInt|get#call(lowered final(core::int, core::int, {required call: (dynamic) → dynamic}) #this) → (dynamic) → dynamic + return (dynamic x) → dynamic => self::EIntIntCallInt|call(#this, x); +static method test((core::int) r1, (core::int, {required call: (dynamic) → dynamic}) r2, (core::int, core::int, {required call: (dynamic) → dynamic}) r3, (core::String) r4, self::test::X1 x1, self::test::X2 x2, self::test::X3 x3, self::test::X4 x4, self::test::X1? x1n, self::test::X2? x2n, self::test::X3? x3n, self::test::X4? x4n) → dynamic + ; diff --git a/pkg/front_end/testcases/records/issue54616_2.dart.weak.transformed.expect b/pkg/front_end/testcases/records/issue54616_2.dart.weak.transformed.expect new file mode 100644 index 00000000000..653cee2bb1c --- /dev/null +++ b/pkg/front_end/testcases/records/issue54616_2.dart.weak.transformed.expect @@ -0,0 +1,161 @@ +library; +// +// Problems in library: +// +// pkg/front_end/testcases/records/issue54616_2.dart:27:3: Error: The 'call' property on the record type isn't directly callable but could be invoked by `.call(...)` +// r2(0); // Error. +// ^ +// +// pkg/front_end/testcases/records/issue54616_2.dart:28:3: Error: The 'call' property on the record type isn't directly callable but could be invoked by `.call(...)` +// r3(0); // Error. +// ^ +// +// pkg/front_end/testcases/records/issue54616_2.dart:29:5: Error: The method 'call' isn't defined for the class '(String)'. +// Try correcting the name to the name of an existing method, or defining a method named 'call'. +// r4(0); // Error. +// ^ +// +// pkg/front_end/testcases/records/issue54616_2.dart:33:6: Error: The method 'call' isn't defined for the class '(String)'. +// Try correcting the name to the name of an existing method, or defining a method named 'call'. +// r4.call(0); // Error. +// ^^^^ +// +// pkg/front_end/testcases/records/issue54616_2.dart:36:3: Error: The 'call' property on the record type isn't directly callable but could be invoked by `.call(...)` +// x2(0); // Error. +// ^ +// +// pkg/front_end/testcases/records/issue54616_2.dart:37:3: Error: The 'call' property on the record type isn't directly callable but could be invoked by `.call(...)` +// x3(0); // Error. +// ^ +// +// pkg/front_end/testcases/records/issue54616_2.dart:38:5: Error: The method 'call' isn't defined for the class '(String)'. +// Try correcting the name to the name of an existing method, or defining a method named 'call'. +// x4(0); // Error. +// ^ +// +// pkg/front_end/testcases/records/issue54616_2.dart:39:6: Error: Can't use an expression of type 'X1?' as a function because it's potentially null. +// Try calling using ?.call instead. +// x1n(0); // Error. +// ^ +// +// pkg/front_end/testcases/records/issue54616_2.dart:40:6: Error: Can't use an expression of type 'X2?' as a function because it's potentially null. +// Try calling using ?.call instead. +// x2n(0); // Error. +// ^ +// +// pkg/front_end/testcases/records/issue54616_2.dart:41:6: Error: Can't use an expression of type 'X3?' as a function because it's potentially null. +// Try calling using ?.call instead. +// x3n(0); // Error. +// ^ +// +// pkg/front_end/testcases/records/issue54616_2.dart:42:6: Error: The method 'call' isn't defined for the class '(String)?'. +// Try correcting the name to the name of an existing method, or defining a method named 'call'. +// x4n(0); // Error. +// ^ +// +// pkg/front_end/testcases/records/issue54616_2.dart:47:6: Error: The method 'call' isn't defined for the class '(String)'. +// Try correcting the name to the name of an existing method, or defining a method named 'call'. +// x4.call(0); // Error. +// ^^^^ +// +// pkg/front_end/testcases/records/issue54616_2.dart:48:7: Error: Method 'call' cannot be called on 'X1?' because it is potentially null. +// Try calling using ?. instead. +// x1n.call(0); // Error. +// ^^^^ +// +// pkg/front_end/testcases/records/issue54616_2.dart:49:7: Error: Can't use an expression of type 'X2?' as a function because it's potentially null. +// Try calling using ?.call instead. +// x2n.call(0); // Error. +// ^ +// +// pkg/front_end/testcases/records/issue54616_2.dart:50:7: Error: Can't use an expression of type 'X3?' as a function because it's potentially null. +// Try calling using ?.call instead. +// x3n.call(0); // Error. +// ^ +// +// pkg/front_end/testcases/records/issue54616_2.dart:51:7: Error: The method 'call' isn't defined for the class '(String)?'. +// Try correcting the name to the name of an existing method, or defining a method named 'call'. +// x4n.call(0); // Error. +// ^^^^ +// +import self as self; +import "dart:core" as core; + +extension EInt on (core::int) { + method call = self::EInt|call; + method tearoff call = self::EInt|get#call; +} +extension EIntIntCallInt on (core::int, core::int, {required call: (dynamic) → dynamic}) { + method call = self::EIntIntCallInt|call; + method tearoff call = self::EIntIntCallInt|get#call; +} +static extension-member method EInt|call(lowered final(core::int) #this, dynamic x) → dynamic + return x; +static extension-member method EInt|get#call(lowered final(core::int) #this) → (dynamic) → dynamic + return (dynamic x) → dynamic => self::EInt|call(#this, x); +static extension-member method EIntIntCallInt|call(lowered final(core::int, core::int, {required call: (dynamic) → dynamic}) #this, dynamic x) → dynamic + return x; +static extension-member method EIntIntCallInt|get#call(lowered final(core::int, core::int, {required call: (dynamic) → dynamic}) #this) → (dynamic) → dynamic + return (dynamic x) → dynamic => self::EIntIntCallInt|call(#this, x); +static method test((core::int) r1, (core::int, {required call: (dynamic) → dynamic}) r2, (core::int, core::int, {required call: (dynamic) → dynamic}) r3, (core::String) r4, self::test::X1 x1, self::test::X2 x2, self::test::X3 x3, self::test::X4 x4, self::test::X1? x1n, self::test::X2? x2n, self::test::X3? x3n, self::test::X4? x4n) → dynamic { + self::EInt|call(r1, 0); + r2.call{(dynamic) → dynamic}(0){(dynamic) → dynamic}; + r3.call{(dynamic) → dynamic}(0){(dynamic) → dynamic}; + invalid-expression "pkg/front_end/testcases/records/issue54616_2.dart:29:5: Error: The method 'call' isn't defined for the class '(String)'. +Try correcting the name to the name of an existing method, or defining a method named 'call'. + r4(0); // Error. + ^" in r4{}.call(0); + self::EInt|call(r1, 0); + r2.call{(dynamic) → dynamic}(0){(dynamic) → dynamic}; + r3.call{(dynamic) → dynamic}(0){(dynamic) → dynamic}; + invalid-expression "pkg/front_end/testcases/records/issue54616_2.dart:33:6: Error: The method 'call' isn't defined for the class '(String)'. +Try correcting the name to the name of an existing method, or defining a method named 'call'. + r4.call(0); // Error. + ^^^^" in r4{}.call(0); + self::EInt|call(x1, 0); + x2.call{(dynamic) → dynamic}(0){(dynamic) → dynamic}; + x3.call{(dynamic) → dynamic}(0){(dynamic) → dynamic}; + invalid-expression "pkg/front_end/testcases/records/issue54616_2.dart:38:5: Error: The method 'call' isn't defined for the class '(String)'. +Try correcting the name to the name of an existing method, or defining a method named 'call'. + x4(0); // Error. + ^" in x4{}.call(0); + invalid-expression "pkg/front_end/testcases/records/issue54616_2.dart:39:6: Error: Can't use an expression of type 'X1?' as a function because it's potentially null. +Try calling using ?.call instead. + x1n(0); // Error. + ^" in self::EInt|call(x1n, 0); + invalid-expression "pkg/front_end/testcases/records/issue54616_2.dart:40:6: Error: Can't use an expression of type 'X2?' as a function because it's potentially null. +Try calling using ?.call instead. + x2n(0); // Error. + ^" in x2n.call{(dynamic) → dynamic}(0){(dynamic) → dynamic}; + invalid-expression "pkg/front_end/testcases/records/issue54616_2.dart:41:6: Error: Can't use an expression of type 'X3?' as a function because it's potentially null. +Try calling using ?.call instead. + x3n(0); // Error. + ^" in x3n.call{(dynamic) → dynamic}(0){(dynamic) → dynamic}; + invalid-expression "pkg/front_end/testcases/records/issue54616_2.dart:42:6: Error: The method 'call' isn't defined for the class '(String)?'. +Try correcting the name to the name of an existing method, or defining a method named 'call'. + x4n(0); // Error. + ^" in x4n{}.call(0); + self::EInt|call(x1, 0); + x2.call{(dynamic) → dynamic}(0){(dynamic) → dynamic}; + x3.call{(dynamic) → dynamic}(0){(dynamic) → dynamic}; + invalid-expression "pkg/front_end/testcases/records/issue54616_2.dart:47:6: Error: The method 'call' isn't defined for the class '(String)'. +Try correcting the name to the name of an existing method, or defining a method named 'call'. + x4.call(0); // Error. + ^^^^" in x4{}.call(0); + invalid-expression "pkg/front_end/testcases/records/issue54616_2.dart:48:7: Error: Method 'call' cannot be called on 'X1?' because it is potentially null. +Try calling using ?. instead. + x1n.call(0); // Error. + ^^^^" in self::EInt|call(x1n, 0); + invalid-expression "pkg/front_end/testcases/records/issue54616_2.dart:49:7: Error: Can't use an expression of type 'X2?' as a function because it's potentially null. +Try calling using ?.call instead. + x2n.call(0); // Error. + ^" in x2n.call{(dynamic) → dynamic}(0){(dynamic) → dynamic}; + invalid-expression "pkg/front_end/testcases/records/issue54616_2.dart:50:7: Error: Can't use an expression of type 'X3?' as a function because it's potentially null. +Try calling using ?.call instead. + x3n.call(0); // Error. + ^" in x3n.call{(dynamic) → dynamic}(0){(dynamic) → dynamic}; + invalid-expression "pkg/front_end/testcases/records/issue54616_2.dart:51:7: Error: The method 'call' isn't defined for the class '(String)?'. +Try correcting the name to the name of an existing method, or defining a method named 'call'. + x4n.call(0); // Error. + ^^^^" in x4n{}.call(0); +}