The bug occurs because the jl_static_show function in rtutils.c is not correctly handling the special case of Core.IntrinsicFunction types. The Symbol name in the MethodTable of jl_intrinsic_type is causing confusion, leading to incorrect representation.
How to reproduce
Execute which(Core.Compiler.is_pure_intrinsic_infer, (Core.IntrinsicFunction,)).sig in Julia REPL.
Pipe the result to Core.println.
Observe the incorrect representation of Core.IntrinsicFunction in the output.
How to fix
Modify the jl_static_show function in rtutils.c to utilize the jl_intrinsic_name function for Core.IntrinsicFunction types. This will ensure the correct identifier is printed.
Update the is_globname_binding function to take an additional argument indicating whether v is the value or type. This will allow branching based on this argument instead of using the || operator, which currently leads to incorrect behavior.
Original issue: #9
Why the bug occurs
The bug occurs because the
jl_static_show
function inrtutils.c
is not correctly handling the special case ofCore.IntrinsicFunction
types. The Symbol name in the MethodTable ofjl_intrinsic_type
is causing confusion, leading to incorrect representation.How to reproduce
which(Core.Compiler.is_pure_intrinsic_infer, (Core.IntrinsicFunction,)).sig
in Julia REPL.Core.println
.Core.IntrinsicFunction
in the output.How to fix
jl_static_show
function inrtutils.c
to utilize thejl_intrinsic_name
function forCore.IntrinsicFunction
types. This will ensure the correct identifier is printed.is_globname_binding
function to take an additional argument indicating whetherv
is the value or type. This will allow branching based on this argument instead of using the||
operator, which currently leads to incorrect behavior.Test these changes locally