diff --git a/vlib/v/ast/table.v b/vlib/v/ast/table.v index 7068dcaec2..42b241b994 100644 --- a/vlib/v/ast/table.v +++ b/vlib/v/ast/table.v @@ -671,7 +671,7 @@ pub fn (t &Table) unalias_num_type(typ Type) Type { sym := t.sym(typ) if sym.kind == .alias { pt := (sym.info as Alias).parent_type - if pt <= f64_type && pt >= void_type { + if pt <= char_type && pt >= void_type { return pt } } diff --git a/vlib/v/tests/alias_char_type_reference_test.v b/vlib/v/tests/alias_char_type_reference_test.v new file mode 100644 index 0000000000..cc4c80cf32 --- /dev/null +++ b/vlib/v/tests/alias_char_type_reference_test.v @@ -0,0 +1,12 @@ +module main + +type ALchar = char + +fn test_alias_char_type_reference() { + c1 := &char(0) + c2 := &ALchar(0) + println('${typeof(c1).name} $c1') + assert '$c1' == '0' + println('${typeof(c2).name} $c2') + assert '$c2' == '0' +}