mirror of
https://github.com/ziglang/zig.git
synced 2024-11-26 23:22:44 +00:00
16 lines
236 B
Zig
16 lines
236 B
Zig
|
const x = 1234;
|
||
|
|
||
|
fn foo() void {
|
||
|
// It works at file scope as well as inside functions.
|
||
|
const y = 5678;
|
||
|
|
||
|
// Once assigned, an identifier cannot be changed.
|
||
|
y += 1;
|
||
|
}
|
||
|
|
||
|
pub fn main() void {
|
||
|
foo();
|
||
|
}
|
||
|
|
||
|
// exe=build_fail
|