mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-25 11:30:15 +01:00
* global variables * implemented type checking of global variable, added test case * added a comment * improvements based on Dave's suggestions * improvements based on Jon's suggestions * added test cases about global variable ordering
14 lines
316 B
Plaintext
14 lines
316 B
Plaintext
// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
|
|
// Exceptions. See /LICENSE for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
|
|
// Test a global variable depending on another global.
|
|
|
|
var Int: x = 0;
|
|
|
|
var Int: y = x;
|
|
|
|
fn main() -> Int {
|
|
return y;
|
|
}
|