Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrating Microsoft.Quantum.Core to the modern Stdlib causes strange errors around resolving primitive types #1911

Open
sezna opened this issue Sep 10, 2024 · 2 comments
Assignees
Labels
bug Something isn't working needs triage

Comments

@sezna
Copy link
Contributor

sezna commented Sep 10, 2024

To reproduce this, check out my branch alex/even-newer-stdlib and run cargo test in library/.

For reasons unknown to me (yet), primitive types fail to resolve when the name of the core library is changed, even when the prelude and other hard-coded references to core are updated in the compiler.

@sezna
Copy link
Contributor Author

sezna commented Sep 10, 2024

@swernli is doing a small investigation

@sezna sezna self-assigned this Sep 11, 2024
@sezna
Copy link
Contributor Author

sezna commented Sep 11, 2024

Figured this one out, fix coming...

github-merge-queue bot pushed a commit that referenced this issue Sep 17, 2024
This PR migrates the standard library into a Q# project structure.

Previously, we provided the modern standard library API via re-export,
while the "true" stdlib was defined in the old explicit-namespace style.
Now, that is inverted: the stdlib's code is housed in a project with
implicit namespaces, and the legacy (`Microsoft.Quantum.____`) API is
provided via re-exports.

Why do this? Well, for one, the standard library should look like a
regular library and use the latest features we have.
Secondarily, auto-imports and other language dev tools now refer to
these items by their `Std.__` name, not their `Microsoft.Quantum.__`
name. See the video below for an example of this in completions:


https://github.com/user-attachments/assets/fa96e5b7-0cca-4a44-9224-7742d50f8370

Go-to def rendering the new paths:


https://github.com/user-attachments/assets/5fea33ec-9478-4c16-9e78-b8f8b1420ed0



Note that `Unstable.*` has not been migrated to the modern API, as we
want to explore stabilizing state preparation (#1910)

Core is also not included, but for different reasons: #1911. Coming in a
Follow Up PR™️ (`alex/1911` if you want to preview the work there)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage
Projects
None yet
Development

No branches or pull requests

1 participant