Skip to content
This repository has been archived by the owner on Jan 12, 2024. It is now read-only.

Compiler should auto-open the Canon and Intrinsic namespaces along with Core #1550

Open
swernli opened this issue Aug 31, 2022 · 0 comments
Open
Labels
enhancement New request or suggestion for an improvement

Comments

@swernli
Copy link
Contributor

swernli commented Aug 31, 2022

Right now the compiler only auto-opens Microsoft.Quantum.Core, but IQ# for convenience in notebook scenarios opens both Microsoft.Quantum.Canon and Microsoft.Quantum.Intrinsic. These two are also part of the default new program created by the QDK. Instead of requiring local developers to add these while notebook developers don't and needing to have the discrepancy handled by the language server used across both scenarios, we can have the compiler auto-open all three namespaces.

This would be a breaking change for only very specific code if it previously did not open one of these namespaces and then defined callables or UDTs that share a name with those in Canon or Intrinsic. If those are not intended as overrides, they will need alias or fully qualified names. However, if they are intended as overrides, the accepted mechanism for overriding items from a namespace is to use one or more target packages. This means that the IsTargetPackage assembly property should be used to disable all auto-open behavior, and existing target packages would be updated to manually open the Core namespace.

@swernli swernli added enhancement New request or suggestion for an improvement needs triage An initial review by a maintainer is needed labels Aug 31, 2022
@bettinaheim bettinaheim removed the needs triage An initial review by a maintainer is needed label Sep 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New request or suggestion for an improvement
Projects
None yet
Development

No branches or pull requests

2 participants