blob: a4545667767139f9994f2ea28c5d4e9c93c04dd7 [file] [log] [blame]
// Copyright (c) 2011, 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.9
/// @assertion The cast expression ensures that an object is a member of a type.
/// typeCast:
/// asOperator type
/// ;
/// asOperator:
/// as
/// ;
/// @description Checks that it is a compile-time error when the second argument
/// of a type cast operator is a function expression rather than a type.
/// @author rodionov
/// @reviewer iefremov
main() {
try {
(int x) => 1 as (num x) => 2;
// ^
// [analyzer] unspecified
// [cfe] unspecified
} catch (x) {}
}