diff --git a/pkg/compiler/lib/src/ssa/codegen.dart b/pkg/compiler/lib/src/ssa/codegen.dart index ca09f13abe9..143d84d01e4 100644 --- a/pkg/compiler/lib/src/ssa/codegen.dart +++ b/pkg/compiler/lib/src/ssa/codegen.dart @@ -5,6 +5,8 @@ import 'dart:collection' show Queue; import 'dart:io'; +// ignore: implementation_imports +import 'package:front_end/src/api_prototype/lowering_predicates.dart'; // ignore: implementation_imports import 'package:front_end/src/api_unstable/dart2js.dart' show Link, relativizeUri; @@ -2407,14 +2409,21 @@ class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor { record_use.Location? location = _recordUseLocation(sourceInformation); + final name = element.name!; + // TODO(https://github.com/dart-lang/native/issues/2948): Record the name of + // the extension instead of the desugared name. + final isExtensionMethod = hasUnnamedExtensionNamePrefix(name); return RecordedCallWithArguments( identifier: RecordedIdentifier( - name: element.name!, + name: name, parent: element.enclosingClass?.name, uri: relativizeUri(Uri.base, uri, Platform.isWindows), ), location: location, - positionalArguments: arguments.map(_findConstant).toList(), + positionalArguments: arguments + .skip(isExtensionMethod ? 1 : 0) + .map(_findConstant) + .toList(), ); } diff --git a/pkg/compiler/test/record_use/record_use_test.dart b/pkg/compiler/test/record_use/record_use_test.dart index 01dd09d44a2..88fe59502ae 100644 --- a/pkg/compiler/test/record_use/record_use_test.dart +++ b/pkg/compiler/test/record_use/record_use_test.dart @@ -142,7 +142,4 @@ const dart2jsNotSupported = { 'named_both.dart', 'named_optional.dart', 'named_required.dart', - // Extension methods are broken. - // https://github.com/dart-lang/native/issues/2926 - 'extension.dart', };