From 8272656ff2366531e002e9831754280ba45e994d Mon Sep 17 00:00:00 2001 From: Sukera Date: Sun, 16 Jul 2023 00:26:59 +0200 Subject: [PATCH] Fix wrong argument checking in `@constfield` macro --- src/util.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util.jl b/src/util.jl index e8564b0..ffc4d8f 100644 --- a/src/util.jl +++ b/src/util.jl @@ -5,7 +5,7 @@ A macro providing compatibility for `const` fields in mutable structs. Gives a `const` `Expr` if supported, otherwise is a noop and just returns the field. """ macro constfield(ex::Expr) - ex.head != :(::) || length(ex.args) != 2 || throw(ArgumentError("`@constfield` only supports expressions of the form `field::Type`!")) + (ex.head == Symbol("::") && length(ex.args) == 2) || throw(ArgumentError("`@constfield` only supports expressions of the form `field::Type`!")) ex = esc(ex) if VERSION < v"1.8" ex