hiroshinishio / julia

The Julia Programming Language
https://julialang.org/
MIT License
0 stars 0 forks source link

GitAuto: Core.println repr wrong for Core.IntrinsicFunction type #14

Closed gitauto-for-dev[bot] closed 3 months ago

gitauto-for-dev[bot] commented 3 months ago

Original issue: #9

Why the bug occurs

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

  1. Execute which(Core.Compiler.is_pure_intrinsic_infer, (Core.IntrinsicFunction,)).sig in Julia REPL.
  2. Pipe the result to Core.println.
  3. Observe the incorrect representation of Core.IntrinsicFunction in the output.

How to fix

  1. 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.
  2. 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.

Test these changes locally

git checkout -b gitauto-wes/issue-#9-a0a343ba-8130-4186-ba54-048cfcfd2a93
git pull origin gitauto-wes/issue-#9-a0a343ba-8130-4186-ba54-048cfcfd2a93