diff --git a/vlib/builtin/int.v b/vlib/builtin/int.v index f790a507d4..9c769d999f 100644 --- a/vlib/builtin/int.v +++ b/vlib/builtin/int.v @@ -7,6 +7,8 @@ module builtin // ----- value to string functions ----- // +type u8 = byte + // ptr_str returns the address of `ptr` as a `string`. pub fn ptr_str(ptr voidptr) string { buf1 := u64(ptr).hex() diff --git a/vlib/v/ast/types.v b/vlib/v/ast/types.v index aab47f53e7..a816030cfd 100644 --- a/vlib/v/ast/types.v +++ b/vlib/v/ast/types.v @@ -670,7 +670,7 @@ pub fn (mut t Table) register_builtin_type_symbols() { } ) t.register_type_symbol(kind: .interface_, name: 'IError', cname: 'IError', mod: 'builtin') - t.register_type_symbol(kind: .u8, name: 'u8', cname: 'u8', mod: 'builtin') + t.register_type_symbol(kind: .u8, name: 'uu8', cname: 'uu8', mod: 'builtin') } [inline] @@ -925,8 +925,8 @@ pub fn (t &Table) type_to_str_using_aliases(typ Type, import_aliases map[string] .int_literal, .float_literal { res = sym.name } - .i8, .i16, .int, .i64, .byte, .u8, .u16, .u32, .u64, .f32, .f64, .char, .rune, .string, .bool, - .none_, .byteptr, .voidptr, .charptr { + .i8, .i16, .int, .i64, .byte, .u8, .u16, .u32, .u64, .f32, .f64, .char, .rune, .string, + .bool, .none_, .byteptr, .voidptr, .charptr { // primitive types if sym.kind == .byteptr { res = '&byte'