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 #10

Closed gitauto-for-dev[bot] closed 2 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 when printed.

How to reproduce

  1. Call which(Core.Compiler.is_pure_intrinsic_infer, (Core.IntrinsicFunction,)).sig and observe the correct output.
  2. Pipe the result to Core.println and observe the incorrect representation.
  3. Check the name and method table name of Core.IntrinsicFunction to see the inconsistency.

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 that the correct identifier is printed.
  2. Update the is_globname_binding function to take an additional argument indicating whether v is a value or type. This will allow the function to branch correctly instead of using the || operator inappropriately.
  3. Test the changes to ensure that the representation is now consistent and correct. """

Test these changes locally

git checkout -b gitauto-wes/issue-#9-83e2c9b0-ceae-4fbe-961b-1167ee319e08
git pull origin gitauto-wes/issue-#9-83e2c9b0-ceae-4fbe-961b-1167ee319e08