Files
sdk/pkg/front_end/testcases/nnbd_mixed/constants_lib.dart
T
Mayank Patke f043f9e5f6 Don't legacy-erase type literals.
Change-Id: Ic924a4ddf27801e0d09952cd0da222cfda4f8b73
Bug: https://github.com/dart-lang/sdk/issues/42262
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150821
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-06-11 13:28:49 +00:00

27 lines
743 B
Dart

// Copyright (c) 2020, 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.
// @dart=2.6
class Class<T> {
final T field;
const Class(this.field);
}
T id<T>(T t) => t;
typedef F1<T> = T Function(T);
typedef F2 = T Function<T>(T);
const c2 = identical;
const int Function(int) partialInstantiation = id;
const instance = const Class<int>(0);
const listLiteral = <int>[0];
const setLiteral = <int>{0};
const mapLiteral = <int, String>{0: 'foo'};
const listConcatenation = <int>[...listLiteral];
const setConcatenation = <int>{...setLiteral};
const mapConcatenation = <int, String>{...mapLiteral};