Skip to content

Commit

Permalink
make the constructorof fallback method non-@generated
Browse files Browse the repository at this point in the history
I don't see a justification for using `@generated`. The effects are
good without it:

```julia-repl
julia> Base.infer_effects(constructorof, Tuple{Type{Int}})
(+c,+e,+n,+t,+s,+m,+u,+o,+r)
```

Updates JuliaObjects#21
  • Loading branch information
nsajko committed Nov 7, 2024
1 parent 72bb19d commit f1037af
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ConstructionBase.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ for (name, path) in [
end
end

@generated function constructorof(::Type{T}) where T
function constructorof(::Type{T}) where T
getfield(parentmodule(T), nameof(T))
end

Expand Down

0 comments on commit f1037af

Please sign in to comment.