mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-24 22:39:04 +00:00
compiler: add support for zero channel constant
This commit is contained in:
@@ -2656,6 +2656,12 @@ func (c *Compiler) parseConst(prefix string, expr *ssa.Const) (llvm.Value, error
|
|||||||
} else {
|
} else {
|
||||||
return llvm.Value{}, errors.New("todo: unknown constant: " + expr.String())
|
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:
|
case *types.Signature:
|
||||||
if expr.Value != nil {
|
if expr.Value != nil {
|
||||||
return llvm.Value{}, errors.New("non-nil signature constant")
|
return llvm.Value{}, errors.New("non-nil signature constant")
|
||||||
|
|||||||
Reference in New Issue
Block a user