1eda15854d
Experiments that have not be enabled by default should only be allowed in the current version of the sdk. Closes #45460 Change-Id: I159f390ac85fe37943920717ce11a4c817d5b4a9 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193480 Commit-Queue: Johnni Winther <johnniwinther@google.com> Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
23 lines
686 B
Dart
23 lines
686 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.
|
|
|
|
class Covariant<out T> {}
|
|
class Contravariant<in T> {}
|
|
class Invariant<inout T> {}
|
|
|
|
void covariantListInfer<T>(Covariant<List<T>> x) {}
|
|
void contravariantListInfer<T>(Contravariant<List<T>> x) {}
|
|
void invariantListInfer<T>(Invariant<List<T>> x) {}
|
|
|
|
main() {
|
|
var cov = new Covariant();
|
|
covariantListInfer(Covariant());
|
|
|
|
var contra = new Contravariant();
|
|
contravariantListInfer(Contravariant());
|
|
|
|
var inv = new Invariant();
|
|
invariantListInfer(Invariant());
|
|
}
|