compiler: process bool literals in a generic way

This commit is contained in:
Evgenii Stratonikov 2020-05-19 15:20:10 +03:00
parent 70d0ff869d
commit aeaa4a8210
2 changed files with 1 additions and 30 deletions

View file

@ -610,14 +610,7 @@ func (c *codegen) Visit(node ast.Node) ast.Visitor {
return nil
case *ast.Ident:
if isIdentBool(n) {
value, err := makeBoolFromIdent(n, c.typeInfo)
if err != nil {
c.prog.Err = err
return nil
}
c.emitLoadConst(value)
} else if tv := c.typeAndValueOf(n); tv.Value != nil {
if tv := c.typeAndValueOf(n); tv.Value != nil {
c.emitLoadConst(tv)
} else {
c.emitLoadVar(n.Name)