Skip to content

Conversation

swernli
Copy link
Collaborator

@swernli swernli commented Mar 10, 2025

This fixes an issue where items from the Main.qs in a project would not be visible with the explicit Main namespace. When the dependency has no alias we should skip the special handling that elides the Main so that items are accessible as expected (and as documented in Running the Programs)

Fixes #2207

@swernli swernli force-pushed the swernli/issue2207 branch from f56e82a to 377d2df Compare March 11, 2025 18:05
@minestarks
Copy link
Member

minestarks commented Mar 11, 2025

The name resolution behavior table of doom:

Caller Python interop Code in same package
/
Entry expr in same package
Code in notebook cell
/
Entry expr from interpreter commands
/
Some code lens actions
Code in dependent package Code in dependent package (stdlib special case)
Item visibility all items all items all items only exports only exports
Main namespace treatment Main exists Main exists Main exists Main is collapsed N/A, no Main in stdlib
Package alias? No No No Yes No
Calling code lives in same or separate HIR package? N/A, no code Same Separate Separate Separate

@DmitryVasilevsky
Copy link
Contributor

DmitryVasilevsky commented Mar 12, 2025

The name resolution behavior table of doom:

@minestarks, Do we have this in the wiki or in the code? Could be useful...

@swernli swernli added this pull request to the merge queue Mar 12, 2025
Merged via the queue into main with commit 52a6bd4 Mar 12, 2025
18 checks passed
@swernli swernli deleted the swernli/issue2207 branch March 12, 2025 23:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Name resolution from a project's Main.qs in Python or Circuits does not work
4 participants