feat: add index and composite literal type checking
This adds type checking to both `IndexExpr` and `CompositeLitExpr` as well as handling any required constant type conversion. This includes a change to the type propagation to the children of a composite literal. Previously in most cases the composite literal type was propagated to its children. This does not work with type checking as the actual child type is needed.
This commit is contained in:
@@ -1315,7 +1315,6 @@ func getIndexMap(n *node) {
|
||||
z := reflect.New(n.child[0].typ.frameType().Elem()).Elem()
|
||||
|
||||
if n.child[1].rval.IsValid() { // constant map index
|
||||
convertConstantValue(n.child[1])
|
||||
mi := n.child[1].rval
|
||||
|
||||
switch {
|
||||
@@ -1409,7 +1408,6 @@ func getIndexMap2(n *node) {
|
||||
return
|
||||
}
|
||||
if n.child[1].rval.IsValid() { // constant map index
|
||||
convertConstantValue(n.child[1])
|
||||
mi := n.child[1].rval
|
||||
switch {
|
||||
case !doValue:
|
||||
|
||||
Reference in New Issue
Block a user