Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit de0fcd7

Browse files
fishythefishcommit-bot@chromium.org
authored andcommitted
[dart2js] Assign the correct type to super tearoffs.
Bug: dart-lang/sdk#40902 Fixes: dart-lang/sdk#40902 Change-Id: Ie2c58e5dab9902cbabd7c2ef9aae5b6c1773c7e7 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138663 Reviewed-by: Stephen Adams <[email protected]>
1 parent 29d4b61 commit de0fcd7

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

pkg/compiler/lib/src/ssa/builder_kernel.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5248,7 +5248,8 @@ class KernelSsaGraphBuilder extends ir.Visitor {
52485248
inputs.addAll(arguments);
52495249

52505250
AbstractValue typeMask;
5251-
if (target is FunctionEntity) {
5251+
if (selector.isGetter && target.isGetter ||
5252+
!selector.isGetter && target is FunctionEntity) {
52525253
typeMask = _typeInferenceMap.getReturnTypeOf(target);
52535254
} else {
52545255
typeMask = _abstractValueDomain.dynamicType;
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Copyright (c) 2020, 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 "package:expect/expect.dart";
6+
7+
class Foo {
8+
int f() => 42;
9+
}
10+
11+
class Bar extends Foo {
12+
void test() {
13+
Expect.isFalse(super.f is int);
14+
}
15+
}
16+
17+
void main() {
18+
Bar().test();
19+
}

0 commit comments

Comments
 (0)