Initial Commit
This commit is contained in:
782 files changed
+145156
No files matched your search
@@ -0,0 +1,10 @@
|
||||
# A branch or arm checked once for each case it holds in says each note once,
|
||||
# with the case where only that case finds it, and an undeclared name an `if
|
||||
# const` tests by is said once.
|
||||
def added<T>(x: T): T { if const T is pointer || T is integer { return x + x; } return x; }
|
||||
def squared<T>(x: T): T { return match const T { integer, pointer => x * x, else => x }; }
|
||||
def missing<T>(x: T): T { if const T is integer || T is real { return nothing_here; } return x; }
|
||||
def target_bits<T>(): u64 { return size_of::<match const T { pointer, integer => T::target, else => T }>(); }
|
||||
def unknown<T>(x: T): u64 { if const T is nowhere { return 1; } return 0; }
|
||||
|
||||
def main(): void {}
|
||||
Reference in new issue
Block a user