-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
It would be appreciated if this library will be updated to compliance with the most recent c3c compiler(0.7+).
When I tried to compile the previous test example which has been compiled successfully with previous c3c compiler(c3c 0.66),it failed with below error information:
14: macro @convert_builder_value(builder, dest, is_null)
15: {
16: switch (dest) {
17: case String:
^^^^^^
(E:/Learning/c3pack/code/sql_c3/src/sql/scanner.c3:17:14) Error: You cannot cast 'typeid' to 'any'.
173:
174: DString builder = dstring::new(allocator::temp());
175: builder.append(tmp_value.str_view());
176: sql::@convert_builder_value(builder, dest, was_null)!;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(E:/Learning/c3pack/code/sql_c3/src/sqlite/sql_impl.c3:176:5) Note: Inlined from here.
part codes of scanner.c3
module sql;
import std::io;
macro @convert_builder_value(builder, dest, is_null)
{
switch (dest) {
case String:
*dest = builder.str_view();
case String*:
@set_null_value(dest, builder.str_view(), is_null);
case ZString:
*dest = builder.zstr_view();
case ZString*:
@set_null_value(dest, builder.zstr_view(), is_null);
case bool:
*dest = (builder.str_view() == "1" || builder.str_view() == "t") ? true : false;
case bool*:
@set_null_value(dest, (builder.str_view() == "1" || builder.str_view() == "t") ? true : false, is_null);
case int:
*dest = builder.str_view().to_int()!;
case int*:
@set_null_value(dest, builder.str_view().to_int()!, is_null);
case int128:
*dest = builder.str_view().to_int128()!;
case int128*:
@set_null_value(dest, builder.str_view().to_int128()!, is_null);
case long:
*dest = builder.str_view().to_long()!;
case long*:
@set_null_value(dest, builder.str_view().to_long()!, is_null);
case short:
*dest = builder.str_view().to_short()!;
case short*:
@set_null_value(dest, builder.str_view().to_short()!, is_null);
case ichar:
*dest = builder.str_view().to_ichar()!;
case ichar*:
@set_null_value(dest, builder.str_view().to_ichar()!, is_null);
case uint128:
*dest = builder.str_view().to_uint128()!;
case uint128*:
@set_null_value(dest, builder.str_view().to_uint128()!, is_null);
case ulong:
*dest = builder.str_view().to_ulong()!;
case ulong*:
@set_null_value(dest, builder.str_view().to_ulong()!, is_null);
case uint:
*dest = builder.str_view().to_uint()!;
case uint*:
@set_null_value(dest, builder.str_view().to_uint()!, is_null);
case ushort:
*dest = builder.str_view().to_ushort()!;
case ushort*:
@set_null_value(dest, builder.str_view().to_ushort()!, is_null);
case char:
*dest = builder.str_view().to_uchar()!;
case char*:
@set_null_value(dest, builder.str_view().to_uchar()!, is_null);
case double:
*dest = builder.str_view().to_double()!;
case double*:
@set_null_value(dest, builder.str_view().to_double()!, is_null);
case float:
*dest = builder.str_view().to_float()!;
case float*:
@set_null_value(dest, builder.str_view().to_float()!, is_null);
default:
return Error.UNSUPPORTED_SCAN_TYPE?;
}
}
Metadata
Metadata
Assignees
Labels
No labels