compiler: add support for zero channel constant

This commit is contained in:
Ayke van Laethem
2019-01-20 17:43:51 +01:00
parent eb34afde4b
commit 101f2e519b
+6
View File
@@ -2656,6 +2656,12 @@ func (c *Compiler) parseConst(prefix string, expr *ssa.Const) (llvm.Value, error
} else {
return llvm.Value{}, errors.New("todo: unknown constant: " + expr.String())
}
case *types.Chan:
sig, err := c.getLLVMType(expr.Type())
if err != nil {
return llvm.Value{}, err
}
return c.getZeroValue(sig)
case *types.Signature:
if expr.Value != nil {
return llvm.Value{}, errors.New("non-nil signature constant")