Skip to content

Commit 841c067

Browse files
committed
TaskNames: Don't rely on nameof
1 parent c0781fe commit 841c067

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/thunk.jl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -362,8 +362,6 @@ function replace_broadcast(fn::Symbol)
362362
end
363363
return fn
364364
end
365-
# For TaskNames logging event
366-
Base.nameof(::ExpandedBroadcast{F}) where F = Symbol('.', nameof(F))
367365

368366
to_namedtuple(;kwargs...) = (;kwargs...)
369367

src/utils/logging-events.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,14 @@ function (::TaskNames)(ev::Event{:start})
105105
if hasproperty(f, :instance) && isdefined(f, :instance)
106106
f = f.instance
107107
end
108-
return "$(nameof(f)) [$id]"
108+
return "$(func_name(f)) [$id]"
109109
end
110110
return
111111
end
112112
(td::TaskNames)(ev::Event{:finish}) = nothing
113+
func_name(f::Function) = nameof(f)
114+
func_name(x) = repr(x)
115+
func_name(::Dagger.ExpandedBroadcast{F}) where F = Symbol('.', nameof(F))
113116

114117
"""
115118
TaskArguments

0 commit comments

Comments
 (0)