Fix #22667: hdrgen: Skip using typedefIdent for basic types#22669
Fix #22667: hdrgen: Skip using typedefIdent for basic types#22669IDONTUSEGH wants to merge 8 commits intodlang:masterfrom
Conversation
|
Thanks for your pull request and interest in making D better, @IDONTUSEGH! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please see CONTRIBUTING.md for more information. If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment. Bugzilla referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog. Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub run digger -- build "master + dmd#22669" |
thewilsonator
left a comment
There was a problem hiding this comment.
Please add the test case from the linked issue, otherwise looks great!
|
I now have doubt after the test failed with my initial change, skipping for This may be related: #20889 cc @dkorpel Both my C & D are rusty, so I may be missing something obvious.. |
…unction return types
|
Ok i figured it out, it was reusing the global shared basic type instances (Type.tvoid, Type.tint32, etc.) when creating typedefs. When insertTypedefToTypedefTab() set typedefIdent on these types, it was directly mutating the shared instance, causing ALL subsequent uses of void or int to appear as the typedef name in the generated .di |
|
Thanks for figuring this out. |
thewilsonator
left a comment
There was a problem hiding this comment.
Otherwise looks great
When generating .di files from ImportC code, a typedef like
typedef void _IO_lock_t;would cause all subsequent uses ofvoidto incorrectly print as_IO_lock_tin function signatures.Fixes #22667