-
-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
convert: Fix panic: heterogeneous tuple with null
Tuples with elements of different types can be converted to homogeneous collections (sets or lists), so long as their elements are unifiable. For example: list("a", "b") // all elements have the same type list("a", 5) // "a" and 5 can be unified to string list("a", 5, null) // null is a valid value for string However, tuples with elements which are not unifiable cannot be converted to homogeneous collections: list(["a"], "b") // no common type for list(string) and string This commit fixes a panic for this failure case, when the tuple contains both non-unifiable types and a null value: list(["a"], "b", null) // should not panic The null value was causing the unification process to result in a list or set of dynamic type, which causes the conversion functions to pass through the original value. This meant that in the final conversion step, we would attempt to construct a list or set of different values, which panics.
- Loading branch information
1 parent
07e6921
commit 4d5a7ef
Showing
2 changed files
with
118 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