Skip to content

Commit

Permalink
Attempt to remove method on ::Type
Browse files Browse the repository at this point in the history
  • Loading branch information
serenity4 committed Jul 28, 2024
1 parent c73435f commit 9e83da3
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/ConstructionBase.jl
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,14 @@ if VERSION >= v"1.7"
end
end
else
properties_are_fields(obj) = properties_are_fields(typeof(obj))
properties_are_fields(T::Type) = !is_propertynames_overloaded(T)
properties_are_fields(obj) = is_propertynames_overloaded(typeof(obj))

function is_propertynames_overloaded(T::Type)::Bool
which(propertynames, Tuple{T}).sig !== Tuple{typeof(propertynames), Any}
end

@generated function check_properties_are_fields(obj)
if !properties_are_fields(obj)
if is_propertynames_overloaded(obj)
return quote
T = typeof(obj)
msg = """
Expand Down

0 comments on commit 9e83da3

Please sign in to comment.