mirror of
https://github.com/go-delve/delve.git
synced 2025-10-28 04:35:19 +08:00
proc: return error when assigning between function variables (#2692)
Fixes #2691
This commit is contained in:
committed by
GitHub
parent
1893c9769b
commit
bdcbcc6836
@ -383,6 +383,13 @@ func (scope *EvalScope) setValue(dstv, srcv *Variable, srcExpr string) error {
|
||||
real, _ := constant.Float64Val(constant.Real(srcv.Value))
|
||||
imag, _ := constant.Float64Val(constant.Imag(srcv.Value))
|
||||
return dstv.writeComplex(real, imag, dstv.RealType.Size())
|
||||
case reflect.Func:
|
||||
if dstv.RealType.Size() == 0 {
|
||||
if dstv.Name != "" {
|
||||
return fmt.Errorf("can not assign to %s", dstv.Name)
|
||||
}
|
||||
return errors.New("can not assign to function expression")
|
||||
}
|
||||
}
|
||||
|
||||
// nilling nillable variables
|
||||
|
||||
Reference in New Issue
Block a user