Skip to content

Commit 1c38b6a

Browse files
nsicchaclaude
andcommitted
Use call syntax in PropertyComputationError display with proper kwarg semicolons
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent eec237d commit 1c38b6a

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

src/DynamicObjects.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1095,12 +1095,12 @@ _cause_error(e::PropertyComputationError) = e.cause isa Tuple ? first(e.cause) :
10951095

10961096
function _format_property_key(name, indices, kwargs)
10971097
s = string(name)
1098-
parts = String[]
1099-
!isempty(indices) && append!(parts, repr.(indices))
1100-
for (k, v) in kwargs
1101-
push!(parts, "$k=$(repr(v))")
1102-
end
1103-
isempty(parts) ? s : s * "[" * join(parts, ", ") * "]"
1098+
pos_parts = !isempty(indices) ? repr.(collect(indices)) : String[]
1099+
kw_parts = ["$k=$(repr(v))" for (k, v) in kwargs]
1100+
all_parts = isempty(pos_parts) && !isempty(kw_parts) ?
1101+
["; " * join(kw_parts, ", ")] :
1102+
vcat(pos_parts, isempty(kw_parts) ? String[] : ["; " * join(kw_parts, ", ")])
1103+
isempty(all_parts) ? s : s * "(" * join(all_parts, ", ") * ")"
11041104
end
11051105

11061106
function Base.showerror(io::IO, e::PropertyComputationError)

0 commit comments

Comments
 (0)