diff --git a/src/StructTypes.jl b/src/StructTypes.jl index 6000fe2..4d69ee2 100644 --- a/src/StructTypes.jl +++ b/src/StructTypes.jl @@ -51,6 +51,10 @@ function lowertype end lowertype(::Type{T}) where {T} = Any +StructType(::Type{Some{T}}) where {T} = CustomStruct() +lower(x::Some) = x.value +lowertype(::Type{Some{T}}) where {T} = T + "A kind of `StructType` where an object's \"data\" is made up, at least in part, by its direct fields. When serializing, appropriate fields will be accessed directly." abstract type DataType <: StructType end diff --git a/test/runtests.jl b/test/runtests.jl index 9618183..5eccadd 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -119,6 +119,9 @@ x = "499beb72-22ea-11ea-3366-55749430b981" v = v"1.2.3" @test StructTypes.StructType(v) == StructTypes.StringType() +# Some wrapper +@test StructTypes.StructType(Some(1)) == StructTypes.CustomStruct() + end struct B