blob: b98b293bf57e726adaedd81f3a76898ef90da965 [file] [log] [blame]
/*
* 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.
*/
/**
* @assertion It is an error to call the default List constructor with a length
* argument and a type argument which is potentially non-nullable.
*
* @description Check that it is an error to call the default List constructor
* with a length argument and a type argument which is potentially non-nullable.
* Test type FutureOr
* @author sgrekhov@unipro.ru
*/
// SharedOptions=--enable-experiment=non-nullable
// Requirements=nnbd-strong
import "dart:async";
typedef void Foo();
class A {}
main() {
new List<FutureOr<Never>>(42);
// ^^^^^^^^^^^^^^^^^^^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified
new List<FutureOr<Never>>(0);
// ^^^^^^^^^^^^^^^^^^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified
new List<FutureOr<Function>>(42);
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified
new List<FutureOr<Function>>(0);
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified
new List<FutureOr<Foo>>(42);
// ^^^^^^^^^^^^^^^^^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified
new List<FutureOr<Foo>>(0);
// ^^^^^^^^^^^^^^^^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified
new List<FutureOr<A>>(42);
// ^^^^^^^^^^^^^^^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified
new List<FutureOr<A>>(0);
// ^^^^^^^^^^^^^^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified
new List<FutureOr<FutureOr<A>>>(42);
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified
new List<FutureOr<FutureOr<A>>>(0);
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified
}