Skip to content

Commit 1d26804

Browse files
natebiggsCommit Queue
authored andcommitted
[dart2wasm] Fix param info lookup to match signature lookup logic.
Change-Id: Id20eb822d9505dda83d09626227e43dd57366ff4 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/431324 Reviewed-by: Ömer Ağacan <[email protected]> Commit-Queue: Nate Biggs <[email protected]>
1 parent 31607cc commit 1d26804

File tree

5 files changed

+64
-1
lines changed

5 files changed

+64
-1
lines changed

pkg/dart2wasm/lib/translator.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1417,7 +1417,8 @@ class Translator with KernelNodes {
14171417
if (target.asMember.isInstanceMember) {
14181418
final table = dispatchTableForTarget(target);
14191419
final selector = table.selectorForTarget(target);
1420-
if (selector.containsTarget(target)) {
1420+
if (selector.containsTarget(target) ||
1421+
selector.isDynamicSubmoduleOverridable) {
14211422
return selector.paramInfo;
14221423
}
14231424
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file
2+
# for details. All rights reserved. Use of this source code is governed by a
3+
# BSD-style license that can be found in the LICENSE file.
4+
extendable:
5+
- library: 'shared/shared.dart'
6+
class: 'Base'
7+
8+
can-be-overridden:
9+
- library: 'shared/shared.dart'
10+
class: 'Base'
11+
member: 'toString'
12+
13+
callable:
14+
- library: 'dart:core'
15+
- library: 'shared/shared.dart'
16+
class: 'Other'
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file
2+
// for details. All rights reserved. Use of this source code is governed by a
3+
// BSD-style license that can be found in the LICENSE file.
4+
5+
import '../../common/testing.dart' as helper;
6+
import 'package:expect/expect.dart';
7+
8+
import 'shared/shared.dart' show Child, Other;
9+
10+
void main() async {
11+
final o1 = Other();
12+
Child();
13+
Expect.equals('Instance of \'Other\'', o1.toString());
14+
Expect.equals(3, await helper.load('entry1.dart'));
15+
helper.done();
16+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file
2+
// for details. All rights reserved. Use of this source code is governed by a
3+
// BSD-style license that can be found in the LICENSE file.
4+
5+
@pragma('dyn-module:entry-point')
6+
Object? dynamicModuleEntrypoint() {
7+
return 3;
8+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file
2+
// for details. All rights reserved. Use of this source code is governed by a
3+
// BSD-style license that can be found in the LICENSE file.
4+
5+
abstract class Base {
6+
const Base();
7+
8+
@override
9+
// ignore: unnecessary_overrides
10+
String toString() => super.toString();
11+
}
12+
13+
class Child extends Base {
14+
@override
15+
// ignore: unnecessary_overrides
16+
String toString() => super.toString();
17+
}
18+
19+
class Other {
20+
@override
21+
String toString({bool? someArg1, bool? someArg2}) => super.toString();
22+
}

0 commit comments

Comments
 (0)