mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-25 08:50:10 +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
23 lines
404 B
Plaintext
23 lines
404 B
Plaintext
********** source program **********
|
|
var Int : x = 1
|
|
fn identity (0 = Int: x) -> () {
|
|
return x;
|
|
|
|
}
|
|
fn main () -> Int {
|
|
return identity(0 = 0);
|
|
|
|
}
|
|
********** type checking **********
|
|
--- step exp Int --->
|
|
--- step exp Int --->
|
|
--- step exp () --->
|
|
--- step exp Int --->
|
|
--- step exp Int --->
|
|
--- step exp Int --->
|
|
--- step exp () --->
|
|
10: type error in return
|
|
expected: Tuple()
|
|
actual: Int
|
|
EXIT CODE: 255
|