Skip to content

Conversation

@quantimnot
Copy link
Contributor

@quantimnot quantimnot commented May 17, 2022

  • Added missing enum fields to macros.NimSymKind.
  • Added some helper functions for getting a symbol's module and package.
  • Added a test of macros.NimSymKind and the new helper funcs.

TODO

* Added missing enum fields to `macros.NimSymKind`.
* Added some helper functions for getting a symbol's module and package.
* Added a test of `macros.NimSymKind` and the new helper funcs.
@quantimnot
Copy link
Contributor Author

Huh?

The nimpy package test fails here:

  block:
    proc getModule(): ptr PyModuleDesc {.importc: "_nimpyModuleDesc_" & name.}
    curModuleDef = getModule()

Why doesn't getModule() match the definition directly above it instead of the func getModule*(node: NimdNode): NimNode I defined in macros? Is this a known bug?

@Araq
Copy link
Member

Araq commented May 23, 2022

What's the use case for these? We have to stop exposing all of the compiler's internals, already it's quite hard to change anything.

@quantimnot
Copy link
Contributor Author

What's the use case for these? We have to stop exposing all of the compiler's internals, already it's quite hard to change anything.

I have no personal use case. I implemented it for correctness and completeness.
I was implementing #19822 and noticed that a module symbol returned a nskStub for its owning package symbol. That seems incorrect.

I understand why some of the other symbol kinds are implementation details that shouldn't leak, but nskPackage seems like it could be useful and is already exposed as the module symbol's owner.

I'm not sure where the mapping between NimSymNode and TSymKind occurs, but could a different method be used so that the enum fields don't need synced?
Is it alright to at least include nskPackage?
What about the convenience funcs?
Is the test useful?

@Araq
Copy link
Member

Araq commented May 24, 2022

Is this a known bug?

It's probably something else like the overload turning getModule into an open symchoice.

@github-actions
Copy link
Contributor

github-actions bot commented Jul 9, 2023

This pull request is stale because it has been open for 1 year with no activity. Contribute more commits on the pull request and rebase it on the latest devel, or it will be closed in 30 days. Thank you for your contributions.

@github-actions github-actions bot added the stale Staled PR/issues; remove the label after fixing them label Jul 9, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Aug 9, 2023

This pull request has been marked as stale and closed due to inactivity after 395 days.

@github-actions github-actions bot closed this Aug 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stale Staled PR/issues; remove the label after fixing them

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants