Files
sdk/pkg/_fe_analyzer_shared/test/constants/data/function.dart
T
Brian Wilkerson 14ff1f2d35 Generate a diagnostic for language overrides prior to 2.12
Change-Id: Ia10cf89443208ef133dd1ce8d68ee7c6b4129fbb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276800
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2023-01-10 05:27:48 +00:00

35 lines
1.1 KiB
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.
// ignore: illegal_language_version_override
// @dart = 2.9
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(
/*cfe|dart2js.Function(method1)*/
/*analyzer.Function(method1,type=T* Function<T>(T*)*)*/
function0);
print(
/*cfe.Instantiation(method1<int>)*/
/*dart2js.Instantiation(method1<int*>)*/
/*analyzer.Function(method1,type=int* Function(int*)*)*/
instantiation0);
print(
/*cfe.Instantiation(method2<String,int>)*/
/*dart2js.Instantiation(method2<String*,int*>)*/
/*analyzer.Function(method2,type=Map<String*, int*>* Function(String*, int*)*)*/
instantiation1);
}