using immutable thread_local on variable declarations

This commit is contained in:
Ginger Bill
2017-01-19 20:03:10 +00:00
parent 563b1e2b28
commit 3f023509a7
10 changed files with 166 additions and 195 deletions
+6 -6
View File
@@ -9,13 +9,13 @@
#import "sync.odin";
#import "utf8.odin";
T :: struct { x, y: int };
thread_local t: T;
main :: proc() {
T :: struct { x, y: int }
foo :: proc(using immutable t: T) {
a0 := t.x;
a1 := x;
x = 123; // Error: Cannot assign to an immutable: `x`
}
immutable using t := T{123, 321};
fmt.println(t);
// foo :: proc(x: ^i32) -> (int, int) {
// fmt.println("^int");