Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/jlgen.jl
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ function unsafe_function_from_type(ft::Type)
Ref{ft}()[]
end
end
global MethodError

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
global MethodError
function MethodError end

imo, it's more conspicuous that this does what you want

Copy link
Member Author

@vchuravy vchuravy Feb 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually that looks more confusing since it seems redundant to the statement below.

In every other situation I would merge a function declaration and a method declaration into one.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough - I agree that neither syntax is really very transparent / consistent

function MethodError(ft::Type{<:Function}, tt::Type, world::Integer=typemax(UInt))
Base.MethodError(unsafe_function_from_type(ft), tt, world)
end
Expand Down
Loading