Files
c3c/test/test_suite/errors/rethrow_macro.c3

14 lines
286 B
Plaintext

module testing;
import std::io;
macro void read(src, Allocator allocator, n)
{
char* data = allocator::malloc_try(allocator, n)!; // #error: Rethrow is only allowed in macros
(void)io::read_all(src, data[:n]);
}
fn void main()
{
ByteReader br;
read(&br, tmem, 10)!!;
}