Skip to content

Commit 101f2e5

Browse files
committed
compiler: add support for zero channel constant
1 parent eb34afd commit 101f2e5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

compiler/compiler.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2656,6 +2656,12 @@ func (c *Compiler) parseConst(prefix string, expr *ssa.Const) (llvm.Value, error
26562656
} else {
26572657
return llvm.Value{}, errors.New("todo: unknown constant: " + expr.String())
26582658
}
2659+
case *types.Chan:
2660+
sig, err := c.getLLVMType(expr.Type())
2661+
if err != nil {
2662+
return llvm.Value{}, err
2663+
}
2664+
return c.getZeroValue(sig)
26592665
case *types.Signature:
26602666
if expr.Value != nil {
26612667
return llvm.Value{}, errors.New("non-nil signature constant")

0 commit comments

Comments
 (0)