blob: 4705da3d9e944b863f3e4414e2c765ef7e5f1126 [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 a compile-time error if a parameterized type [T] is
* super-bounded when it is used in any of the following ways:
* [T] is an immediate subterm of a new expression (16.15.1) or a constant
* object expression
* @description Checks that compile error is thrown when not well-bounded
* parametrized type is used in the constant object expression with [as]
* constructions.
* @author iarkh@unipro.ru
*/
class A<T extends A<T>> {}
main() {
var b1 = null as A<int>?;
// [error line 20, column 0]
// [analyzer] unspecified
// [cfe] unspecified
var b2 = null as A<A<int>>?;
// [error line 24, column 0]
// [analyzer] unspecified
// [cfe] unspecified
}