mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
14 lines
228 B
Plaintext
14 lines
228 B
Plaintext
import std;
|
|
struct Result @generic(WithType2)
|
|
{
|
|
fault error;
|
|
}
|
|
macro Result{WithType} err(fault error) @generic(WithType) => { .error = error };
|
|
|
|
faultdef TESTIN;
|
|
|
|
fn int main()
|
|
{
|
|
Result{int} x = err{int}(TESTIN);
|
|
return 0;
|
|
} |