ast: fix reference of alias char type (#12951)
parent
92bd55ded6
commit
c0dcd1a9a5
|
@ -671,7 +671,7 @@ pub fn (t &Table) unalias_num_type(typ Type) Type {
|
||||||
sym := t.sym(typ)
|
sym := t.sym(typ)
|
||||||
if sym.kind == .alias {
|
if sym.kind == .alias {
|
||||||
pt := (sym.info as Alias).parent_type
|
pt := (sym.info as Alias).parent_type
|
||||||
if pt <= f64_type && pt >= void_type {
|
if pt <= char_type && pt >= void_type {
|
||||||
return pt
|
return pt
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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