dart-sdk/tests/language_2/regress/regress33479_test.dart
Robert Nystrom fc1b1ecc71 Move files under language_2 into subdirectories.
Change-Id: Idbcc965a27e9ffeedf5e0a1068b019de4193070f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127745
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2019-12-11 19:18:00 +00:00

29 lines
1.1 KiB
Dart

class Hest<TypeX extends Fisk> {}
// ^^^^
// [analyzer] COMPILE_TIME_ERROR.GENERIC_FUNCTION_TYPE_CANNOT_BE_BOUND
typedef Fisk = void Function // don't merge lines
// [error line 5, column 1, length 462]
// [analyzer] COMPILE_TIME_ERROR.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF
// ^
// [cfe] Generic type 'Fisk' can't be used without type arguments in the bounds of its own type variables. It is referenced indirectly through 'Hest'.
<TypeY extends Hest>
// ^^^^
// [analyzer] COMPILE_TIME_ERROR.GENERIC_FUNCTION_TYPE_CANNOT_BE_TYPE_ARGUMENT
();
main() {
Hest hest = new Hest();
//^^^^
// [analyzer] COMPILE_TIME_ERROR.GENERIC_FUNCTION_TYPE_CANNOT_BE_TYPE_ARGUMENT
// ^
// [cfe] A generic function type can't be used as a type argument.
// ^^^^^^^^^^
// [analyzer] COMPILE_TIME_ERROR.INVALID_CAST_NEW_EXPR
// ^^^^
// [analyzer] COMPILE_TIME_ERROR.COULD_NOT_INFER
// [cfe] Generic function type 'void Function<TypeY>()' inferred as a type argument.
// ^^^^
// [analyzer] COMPILE_TIME_ERROR.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS
}