6ac6baae8e
When calling Object methods on dynamic receivers, record the interfaceTarget it Kernel. Back ends will use this to treat the call as a statically typed one. This is half of the problem in https://github.com/dart-lang/sdk/issues/33293 Bug: https://github.com/dart-lang/sdk/issues/33293 Change-Id: I8d05903e5b85370a4e697ad3afc494cbc14bcc6a Reviewed-on: https://dart-review.googlesource.com/57820 Commit-Queue: Kevin Millikin <kmillikin@google.com> Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
17 lines
583 B
Dart
17 lines
583 B
Dart
// Copyright (c) 2018, 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.
|
|
|
|
/*@testedFeatures=inference*/
|
|
|
|
void test() {
|
|
List<dynamic> l = /*@typeArgs=dynamic*/ [1, "hello"];
|
|
List<String> l2 = l
|
|
. /*@target=Iterable::map*/ /*@typeArgs=String*/ map(
|
|
/*@returnType=String*/ (dynamic element) =>
|
|
element. /*@target=Object::toString*/ toString())
|
|
. /*@target=Iterable::toList*/ toList();
|
|
}
|
|
|
|
void main() {}
|