2022-11-20 12:18:14 +03:00
|
|
|
module json2
|
|
|
|
|
2022-11-26 19:23:26 +03:00
|
|
|
fn gen_workaround[T](result T) T {
|
2022-11-20 12:18:14 +03:00
|
|
|
return result
|
|
|
|
}
|
|
|
|
|
2022-11-26 19:23:26 +03:00
|
|
|
fn gen_workaround_result[T](result T) ?T {
|
2022-11-20 12:18:14 +03:00
|
|
|
return result
|
|
|
|
}
|
|
|
|
|
2022-11-26 19:23:26 +03:00
|
|
|
fn gen_workaround_optional[T](result T) !T {
|
2022-11-20 12:18:14 +03:00
|
|
|
return result
|
|
|
|
}
|
|
|
|
|
|
|
|
const (
|
2022-11-26 19:23:26 +03:00
|
|
|
string_type_idx = typeof(gen_workaround[string](unsafe { nil })).idx
|
|
|
|
result_string_type_idx = typeof(gen_workaround_result[string](unsafe { nil })).idx
|
|
|
|
optional_string_type_idx = typeof(gen_workaround_optional[string](unsafe { nil })).idx
|
2022-11-20 12:18:14 +03:00
|
|
|
|
2022-11-26 19:23:26 +03:00
|
|
|
int_type_idx = typeof(gen_workaround[int](unsafe { nil })).idx
|
|
|
|
result_int_type_idx = typeof(gen_workaround_result[int](unsafe { nil })).idx
|
|
|
|
optional_int_type_idx = typeof(gen_workaround_optional[int](unsafe { nil })).idx
|
2022-11-20 12:18:14 +03:00
|
|
|
|
2022-11-26 19:23:26 +03:00
|
|
|
int_array_type_idx = typeof(gen_workaround[[]int](unsafe { nil })).idx
|
|
|
|
result_int_array_type_idx = typeof(gen_workaround_result[[]int](unsafe { nil })).idx
|
|
|
|
optional_int_array_type_idx = typeof(gen_workaround_optional[[]int](unsafe { nil })).idx
|
2022-11-20 12:18:14 +03:00
|
|
|
|
2022-11-26 19:23:26 +03:00
|
|
|
byte_array_type_idx = typeof(gen_workaround[[]byte](unsafe { nil })).idx
|
|
|
|
result_byte_array_type_idx = typeof(gen_workaround_result[[]byte](unsafe { nil })).idx
|
|
|
|
optional_byte_array_type_idx = typeof(gen_workaround_optional[[]byte](unsafe { nil })).idx
|
2022-11-20 12:18:14 +03:00
|
|
|
)
|