test150

Undocumented in source.
immutable
@TestInfo(&tester150, [HostSymbol("printStr", cast(void*)&external_print_string), HostSymbol("printInt", cast(void*)&external_print_i64_func)])
auto test150 = q{--- test150 // $isInteger + IFTI @extern(module, "host") void printStr(u8[]); @extern(module, "host") void printInt(i64 i); $alias selectPrintFunc($type T) { if ($isInteger(T)) return printInt; if ($isSlice(T)) return printStr; $compileError("Invalid type"); } void write[T](T val) { alias func = selectPrintFunc(T); func(val); } void run() { write("Hello"); write(42); } };

Meta