global_variable8.carbon 345 B

1234567891011121314
  1. // Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. // Exceptions. See /LICENSE for license information.
  3. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. // Test that a global variable may not depend on a later global.
  5. // Error expected.
  6. var x: Int = y;
  7. var y: Int = 0;
  8. fn main() -> Int {
  9. return x;
  10. }