fix: convert type properly to the correct type
This commit is contained in:
15
_test/composite11.go
Normal file
15
_test/composite11.go
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"image/color"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
c := color.NRGBA64{1, 1, 1, 1}
|
||||||
|
|
||||||
|
fmt.Println(c)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Output:
|
||||||
|
// {1 1 1 1}
|
||||||
@@ -2011,10 +2011,11 @@ func compositeBinStruct(n *node) {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
fieldIndex[i] = []int{i}
|
fieldIndex[i] = []int{i}
|
||||||
convertLiteralValue(c.child[1], typ.Field(i).Type)
|
|
||||||
if c.typ.cat == funcT {
|
if c.typ.cat == funcT {
|
||||||
|
convertLiteralValue(c.child[1], typ.Field(i).Type)
|
||||||
values[i] = genFunctionWrapper(c.child[1])
|
values[i] = genFunctionWrapper(c.child[1])
|
||||||
} else {
|
} else {
|
||||||
|
convertLiteralValue(c, typ.Field(i).Type)
|
||||||
values[i] = genValue(c)
|
values[i] = genValue(c)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user