From 1d994528a698262a1bbe804eaaa173a9c2c9dfeb Mon Sep 17 00:00:00 2001 From: Mandar Chitre Date: Fri, 1 Mar 2024 00:06:51 +0800 Subject: [PATCH] fix(msg): extend byte <> UInt8 conversion to union types --- src/msg.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/msg.jl b/src/msg.jl index 701e7c7..9df333b 100644 --- a/src/msg.jl +++ b/src/msg.jl @@ -158,7 +158,7 @@ function trysetproperty!(s::Message, p::Symbol, v) hasfield(typeof(s), p) || return s ftype = fieldtype(typeof(s), p) ftype === Symbol && (v = Symbol(v)) - ftype === Vector{UInt8} && v isa Vector{Int8} && (v = reinterpret(UInt8, v)) + Vector{UInt8} <: ftype && v isa Vector{Int8} && (v = reinterpret(UInt8, v)) if v === nothing ftype === Float32 && (v = NaN32) ftype === Float64 && (v = NaN64)