Files
sdk/pkg/front_end/test/constants/data/function.dart
T
Johnni Winther 78224f9b0c [cfe+analyzer+dart2js] Support union markers in id-testing
Supports markers like `cfe|analyzer.` to annotated that the expected
result is for both `cfe` and `analyzer`.

Change-Id: Ie69809db5f63a9ee9b87ff1513b819fe85ce0bce
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/110500
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-07-26 17:18:01 +00:00

29 lines
950 B
Dart

// Copyright (c) 2019, 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.
T method1<T>(T t) => t;
Map<T, S> method2<T, S>(T t, S s) => {t: s};
const function0 = /*cfe.Function(method1)*/ method1;
const int Function(int) instantiation0 =
/*cfe.Instantiation(method1<int>)*/ method1;
const Map<String, int> Function(String, int) instantiation1 =
/*cfe.Instantiation(method2<String,int>)*/ method2;
main() {
print(/*Function(method1)*/ function0);
// TODO(paulberry): analyzer should record instantiation information. See
// dartbug.com/37608.
print(
/*cfe|dart2js.Instantiation(method1<int>)*/
/*analyzer.Function(method1)*/
instantiation0);
print(
/*cfe|dart2js.Instantiation(method2<String,int>)*/
/*analyzer.Function(method2)*/
instantiation1);
}