dart-sdk/tests/language/regress/regress48304_test.dart
Johnni Winther 1f848492b7 [dart2js] Compute the correct selector for InstanceGetterInvocation
The Selector computed for InstanceGetterInvocation used the name of
the getter eventhough the invocation is actually a .call invocation.
This lead the computation of whether type arguments need to be parsed
to fail because it queried with the wrong selector.

Closes https://github.com/dart-lang/sdk/issues/48304

Change-Id: Ia08fb91fa24b5b04eba850f75f9b66cb89494dda
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/234288
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2022-03-01 08:55:17 +00:00

33 lines
737 B
Dart

// Copyright (c) 2022, 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.
import 'package:expect/expect.dart';
final String expected = '$A';
abstract class B {
call<T>();
}
class C implements B {
call<T>() => '$T';
}
abstract class A {}
class Wrapper {
Wrapper(this.b, this.call);
final B b;
final B call;
}
void main() {
B b = C();
Expect.equals(b<A>(), expected);
Expect.equals(Wrapper(b, b).b<A>(), expected);
Expect.equals((Wrapper(b, b).b)<A>(), expected);
Expect.equals(Wrapper(b, b).call<A>(), expected);
Expect.equals((Wrapper(b, b).call)<A>(), expected);
}