node: add more diagnostics for mixed array/map literals
This commit is contained in:
parent
d3d3d34116
commit
48f3014429
5
node.go
5
node.go
@ -1658,8 +1658,9 @@ func (this *conversionState) convertArrayLiteralCommon(items []node.Node) (strin
|
||||
if idx == 0 {
|
||||
isMapType = (itm.Key != nil)
|
||||
} else {
|
||||
if isMapType != (itm.Key != nil) {
|
||||
return "", parseErr{itm, fmt.Errorf("Can't represent array and map in a single type")}
|
||||
thisElemIsMapType := (itm.Key != nil)
|
||||
if isMapType != thisElemIsMapType {
|
||||
return "", parseErr{itm, fmt.Errorf("Can't represent array and map in a single type (idx[0].isMap=%v != idx[%d].isMap=%v)", isMapType, idx, thisElemIsMapType)}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user