mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
ast: fix reference of alias char type (#12951)
This commit is contained in:
parent
92bd55ded6
commit
c0dcd1a9a5
@ -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
|
||||
}
|
||||
}
|
||||
|
12
vlib/v/tests/alias_char_type_reference_test.v
Normal file
12
vlib/v/tests/alias_char_type_reference_test.v
Normal file
@ -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'
|
||||
}
|
Loading…
Reference in New Issue
Block a user