blob: bb4c37eefcc0bae4a64ae7b449d9193bb9e24708 [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.
/// @assertion It is a compile-time error to reference a local function
/// before its declaration.
/// @description Checks that it is a compile-error to declare mutually recursive
/// functions, because the first one uses the second before declaration.
/// @author ilya
main() {
evenHandler(x) => x.isEven ? 1 : oddHandler(x);
// ^
// [analyzer] unspecified
// [cfe] unspecified
oddHandler(x) => x.isOdd ? 1 : evenHandler(x);
//^
// [cfe] unspecified
evenHandler(1);
}