fix: automatic type conversion for untyped arg of append (#177)
This commit is contained in:
committed by
Ludovic Fernandez
parent
5cdcf61e0e
commit
c6c7f8cea6
@@ -39,6 +39,13 @@ func genValueRecv(n *Node) func(*Frame) reflect.Value {
|
||||
}
|
||||
}
|
||||
|
||||
func genValueAs(n *Node, t reflect.Type) func(*Frame) reflect.Value {
|
||||
v := genValue(n)
|
||||
return func(f *Frame) reflect.Value {
|
||||
return v(f).Convert(t)
|
||||
}
|
||||
}
|
||||
|
||||
func genValue(n *Node) func(*Frame) reflect.Value {
|
||||
switch n.kind {
|
||||
case BasicLit, FuncDecl:
|
||||
|
||||
Reference in New Issue
Block a user