Skip to content

Commit

Permalink
Remove 'Array' variant from type serialization
Browse files Browse the repository at this point in the history
  • Loading branch information
aborgna-q committed Dec 11, 2024
1 parent c41ec7f commit 25bb478
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 133 deletions.
5 changes: 0 additions & 5 deletions hugr-core/src/types/serialize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ use super::custom::CustomType;
use crate::extension::prelude::{qb_t, usize_t};
use crate::extension::SignatureError;
use crate::ops::AliasDecl;
use crate::std_extensions::collections::array::array_type;

#[derive(serde::Serialize, serde::Deserialize, Clone, Debug)]
#[serde(tag = "t")]
Expand All @@ -14,7 +13,6 @@ pub(super) enum SerSimpleType {
I,
G(Box<FuncValueType>),
Sum(SumType),
Array { inner: Box<SerSimpleType>, len: u64 },
Opaque(CustomType),
Alias(AliasDecl),
V { i: usize, b: TypeBound },
Expand Down Expand Up @@ -51,9 +49,6 @@ impl<RV: MaybeRV> TryFrom<SerSimpleType> for TypeBase<RV> {
SerSimpleType::I => usize_t().into_(),
SerSimpleType::G(sig) => TypeBase::new_function(*sig),
SerSimpleType::Sum(st) => st.into(),
SerSimpleType::Array { inner, len } => {
array_type(len, (*inner).try_into().unwrap()).into_()
}
SerSimpleType::Opaque(o) => TypeBase::new_extension(o),
SerSimpleType::Alias(a) => TypeBase::new_alias(a),
SerSimpleType::V { i, b } => TypeBase::new_var_use(i, b),
Expand Down
32 changes: 0 additions & 32 deletions specification/schema/hugr_schema_live.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,34 +92,6 @@
"title": "AliasDefn",
"type": "object"
},
"Array": {
"additionalProperties": true,
"description": "Known size array whose elements are of the same type.",
"properties": {
"t": {
"const": "Array",
"default": "Array",
"enum": [
"Array"
],
"title": "T",
"type": "string"
},
"inner": {
"$ref": "#/$defs/Type"
},
"len": {
"title": "Len",
"type": "integer"
}
},
"required": [
"inner",
"len"
],
"title": "Array",
"type": "object"
},
"BoundedNatArg": {
"additionalProperties": true,
"properties": {
Expand Down Expand Up @@ -1794,7 +1766,6 @@
"discriminator": {
"mapping": {
"Alias": "#/$defs/Alias",
"Array": "#/$defs/Array",
"G": "#/$defs/FunctionType",
"I": "#/$defs/USize",
"Opaque": "#/$defs/Opaque",
Expand All @@ -1821,9 +1792,6 @@
{
"$ref": "#/$defs/FunctionType"
},
{
"$ref": "#/$defs/Array"
},
{
"$ref": "#/$defs/SumType"
},
Expand Down
32 changes: 0 additions & 32 deletions specification/schema/hugr_schema_strict_live.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,34 +92,6 @@
"title": "AliasDefn",
"type": "object"
},
"Array": {
"additionalProperties": false,
"description": "Known size array whose elements are of the same type.",
"properties": {
"t": {
"const": "Array",
"default": "Array",
"enum": [
"Array"
],
"title": "T",
"type": "string"
},
"inner": {
"$ref": "#/$defs/Type"
},
"len": {
"title": "Len",
"type": "integer"
}
},
"required": [
"inner",
"len"
],
"title": "Array",
"type": "object"
},
"BoundedNatArg": {
"additionalProperties": false,
"properties": {
Expand Down Expand Up @@ -1794,7 +1766,6 @@
"discriminator": {
"mapping": {
"Alias": "#/$defs/Alias",
"Array": "#/$defs/Array",
"G": "#/$defs/FunctionType",
"I": "#/$defs/USize",
"Opaque": "#/$defs/Opaque",
Expand All @@ -1821,9 +1792,6 @@
{
"$ref": "#/$defs/FunctionType"
},
{
"$ref": "#/$defs/Array"
},
{
"$ref": "#/$defs/SumType"
},
Expand Down
32 changes: 0 additions & 32 deletions specification/schema/testing_hugr_schema_live.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,34 +92,6 @@
"title": "AliasDefn",
"type": "object"
},
"Array": {
"additionalProperties": true,
"description": "Known size array whose elements are of the same type.",
"properties": {
"t": {
"const": "Array",
"default": "Array",
"enum": [
"Array"
],
"title": "T",
"type": "string"
},
"inner": {
"$ref": "#/$defs/Type"
},
"len": {
"title": "Len",
"type": "integer"
}
},
"required": [
"inner",
"len"
],
"title": "Array",
"type": "object"
},
"BoundedNatArg": {
"additionalProperties": true,
"properties": {
Expand Down Expand Up @@ -1872,7 +1844,6 @@
"discriminator": {
"mapping": {
"Alias": "#/$defs/Alias",
"Array": "#/$defs/Array",
"G": "#/$defs/FunctionType",
"I": "#/$defs/USize",
"Opaque": "#/$defs/Opaque",
Expand All @@ -1899,9 +1870,6 @@
{
"$ref": "#/$defs/FunctionType"
},
{
"$ref": "#/$defs/Array"
},
{
"$ref": "#/$defs/SumType"
},
Expand Down
32 changes: 0 additions & 32 deletions specification/schema/testing_hugr_schema_strict_live.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,34 +92,6 @@
"title": "AliasDefn",
"type": "object"
},
"Array": {
"additionalProperties": false,
"description": "Known size array whose elements are of the same type.",
"properties": {
"t": {
"const": "Array",
"default": "Array",
"enum": [
"Array"
],
"title": "T",
"type": "string"
},
"inner": {
"$ref": "#/$defs/Type"
},
"len": {
"title": "Len",
"type": "integer"
}
},
"required": [
"inner",
"len"
],
"title": "Array",
"type": "object"
},
"BoundedNatArg": {
"additionalProperties": false,
"properties": {
Expand Down Expand Up @@ -1872,7 +1844,6 @@
"discriminator": {
"mapping": {
"Alias": "#/$defs/Alias",
"Array": "#/$defs/Array",
"G": "#/$defs/FunctionType",
"I": "#/$defs/USize",
"Opaque": "#/$defs/Opaque",
Expand All @@ -1899,9 +1870,6 @@
{
"$ref": "#/$defs/FunctionType"
},
{
"$ref": "#/$defs/Array"
},
{
"$ref": "#/$defs/SumType"
},
Expand Down

0 comments on commit 25bb478

Please sign in to comment.