Skip to content

Commit

Permalink
types: Sort any elements during construction (#3805)
Browse files Browse the repository at this point in the history
* types: Sort any elements during construction

This changes updates the implementation of the any type to sort
elements during construction. This way the Compare() function does not
have to sort elements before recursing (which can result in data races
if global type instances from the built-in function declarations or
elsewhere are compared.)

Fixes #3793

* capabilities.json: changed ordering
* internal/presentation: fix json error output

Co-authored-by: Torin Sandall <[email protected]>
Co-authored-by: Stephan Renatus <[email protected]>
Signed-off-by: Torin Sandall <[email protected]>
  • Loading branch information
tsandall and srenatus authored Sep 20, 2021
1 parent 5a86472 commit f4d9c22
Show file tree
Hide file tree
Showing 4 changed files with 139 additions and 94 deletions.
172 changes: 86 additions & 86 deletions capabilities.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@
{
"of": [
{
"of": {
"dynamic": {
"type": "any"
},
"type": "set"
"type": "array"
},
{
"dynamic": {
"of": {
"type": "any"
},
"type": "array"
"type": "set"
}
],
"type": "any"
Expand Down Expand Up @@ -76,16 +76,16 @@
{
"of": [
{
"of": {
"dynamic": {
"type": "any"
},
"type": "set"
"type": "array"
},
{
"dynamic": {
"of": {
"type": "any"
},
"type": "array"
"type": "set"
}
],
"type": "any"
Expand Down Expand Up @@ -472,16 +472,16 @@
{
"of": [
{
"of": {
"dynamic": {
"type": "string"
},
"type": "set"
"type": "array"
},
{
"dynamic": {
"of": {
"type": "string"
},
"type": "array"
"type": "set"
}
],
"type": "any"
Expand Down Expand Up @@ -517,10 +517,7 @@
{
"of": [
{
"of": {
"type": "any"
},
"type": "set"
"type": "string"
},
{
"dynamic": {
Expand All @@ -540,7 +537,10 @@
"type": "object"
},
{
"type": "string"
"of": {
"type": "any"
},
"type": "set"
}
],
"type": "any"
Expand Down Expand Up @@ -847,16 +847,16 @@
"value": {
"of": [
{
"of": {
"dynamic": {
"type": "any"
},
"type": "set"
"type": "array"
},
{
"dynamic": {
"of": {
"type": "any"
},
"type": "array"
"type": "set"
}
],
"type": "any"
Expand All @@ -867,16 +867,16 @@
{
"of": [
{
"of": {
"dynamic": {
"type": "any"
},
"type": "set"
"type": "array"
},
{
"dynamic": {
"of": {
"type": "any"
},
"type": "array"
"type": "set"
}
],
"type": "any"
Expand Down Expand Up @@ -1747,16 +1747,16 @@
{
"of": [
{
"of": {
"dynamic": {
"type": "any"
},
"type": "set"
"type": "array"
},
{
"dynamic": {
"of": {
"type": "any"
},
"type": "array"
"type": "set"
}
],
"type": "any"
Expand All @@ -1775,16 +1775,16 @@
{
"of": [
{
"of": {
"dynamic": {
"type": "any"
},
"type": "set"
"type": "array"
},
{
"dynamic": {
"of": {
"type": "any"
},
"type": "array"
"type": "set"
}
],
"type": "any"
Expand Down Expand Up @@ -1926,23 +1926,6 @@
},
"type": "array"
},
{
"of": {
"of": [
{
"type": "string"
},
{
"dynamic": {
"type": "any"
},
"type": "array"
}
],
"type": "any"
},
"type": "set"
},
{
"dynamic": {
"key": {
Expand All @@ -1964,17 +1947,9 @@
}
},
"type": "object"
}
],
"type": "any"
},
{
"of": [
{
"type": "string"
},
{
"dynamic": {
"of": {
"of": [
{
"type": "string"
Expand All @@ -1988,10 +1963,18 @@
],
"type": "any"
},
"type": "array"
"type": "set"
}
],
"type": "any"
},
{
"of": [
{
"type": "string"
},
{
"of": {
"dynamic": {
"of": [
{
"type": "string"
Expand All @@ -2005,7 +1988,7 @@
],
"type": "any"
},
"type": "set"
"type": "array"
},
{
"dynamic": {
Expand All @@ -2028,6 +2011,23 @@
}
},
"type": "object"
},
{
"of": {
"of": [
{
"type": "string"
},
{
"dynamic": {
"type": "any"
},
"type": "array"
}
],
"type": "any"
},
"type": "set"
}
],
"type": "any"
Expand Down Expand Up @@ -2180,12 +2180,6 @@
},
"type": "array"
},
{
"of": {
"type": "any"
},
"type": "set"
},
{
"dynamic": {
"key": {
Expand All @@ -2196,6 +2190,12 @@
}
},
"type": "object"
},
{
"of": {
"type": "any"
},
"type": "set"
}
],
"type": "any"
Expand Down Expand Up @@ -2258,12 +2258,6 @@
},
"type": "array"
},
{
"of": {
"type": "any"
},
"type": "set"
},
{
"dynamic": {
"key": {
Expand All @@ -2274,6 +2268,12 @@
}
},
"type": "object"
},
{
"of": {
"type": "any"
},
"type": "set"
}
],
"type": "any"
Expand Down Expand Up @@ -2387,16 +2387,16 @@
{
"of": [
{
"of": {
"dynamic": {
"type": "number"
},
"type": "set"
"type": "array"
},
{
"dynamic": {
"of": {
"type": "number"
},
"type": "array"
"type": "set"
}
],
"type": "any"
Expand Down Expand Up @@ -2856,16 +2856,16 @@
{
"of": [
{
"of": {
"dynamic": {
"type": "number"
},
"type": "set"
"type": "array"
},
{
"dynamic": {
"of": {
"type": "number"
},
"type": "array"
"type": "set"
}
],
"type": "any"
Expand Down Expand Up @@ -3142,16 +3142,16 @@
{
"of": [
{
"type": "number"
"type": "null"
},
{
"type": "string"
"type": "boolean"
},
{
"type": "boolean"
"type": "number"
},
{
"type": "null"
"type": "string"
}
],
"type": "any"
Expand Down
Loading

0 comments on commit f4d9c22

Please sign in to comment.