Fix error report of type mismatch on inline tables (#853)
Parser did not track the location of the faulty inline table in the document, and unmarshaler tried to the use the non-raw data field of the AST node, both resulting into a panic when generating the parser error. Fixes #850
This commit is contained in:
+1
-1
@@ -746,7 +746,7 @@ func (d *decoder) unmarshalInlineTable(itable *unstable.Node, v reflect.Value) e
|
||||
}
|
||||
return d.unmarshalInlineTable(itable, elem)
|
||||
default:
|
||||
return unstable.NewParserError(itable.Data, "cannot store inline table in Go type %s", v.Kind())
|
||||
return unstable.NewParserError(d.p.Raw(itable.Raw), "cannot store inline table in Go type %s", v.Kind())
|
||||
}
|
||||
|
||||
it := itable.Children()
|
||||
|
||||
Reference in New Issue
Block a user