-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
types: Fix panic on reference to object with composite key
The type checker was panicing when given a reference to an object with a composite key because internally it infers the key type using ast.ValueToInterface (which returns map[string]interface{} and not map[interface{}]interface{}). This change updates the types package to support map[string]interface{} internally. Fixing the TypeOf function resolved the panic but it surfaced another issue in the type checker where errors were returned if objects or arrays were dereferenced with composite keys--in case of arrays, the result is undefined but in the case of objects, this is valid. Fixes #2648 Signed-off-by: Torin Sandall <torinsandall@gmail.com>
- Loading branch information
Showing
4 changed files
with
46 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters