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 when using Core.println.
How to reproduce
Execute which(Core.Compiler.is_pure_intrinsic_infer, (Core.IntrinsicFunction,)).sig in Julia REPL to get the correct signature.
Pipe the result to Core.println to observe the incorrect representation.
Check the name and method table name of Core.IntrinsicFunction to see the discrepancies.
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 that the correct identifier is printed.
Update the is_globname_binding function to take an additional argument indicating whether v is a value or type. This will allow branching based on this argument instead of using the || operator, which currently leads to incorrect behavior.
Test the changes to ensure that the representation is now correct and that no other functionality is affected.
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 when usingCore.println
.How to reproduce
which(Core.Compiler.is_pure_intrinsic_infer, (Core.IntrinsicFunction,)).sig
in Julia REPL to get the correct signature.Core.println
to observe the incorrect representation.Core.IntrinsicFunction
to see the discrepancies.How to fix
jl_static_show
function inrtutils.c
to utilize thejl_intrinsic_name
function forCore.IntrinsicFunction
types. This will ensure that the correct identifier is printed.is_globname_binding
function to take an additional argument indicating whetherv
is a 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