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

Improved deprecation notes #1451

Open
troelsfr opened this issue May 31, 2022 · 0 comments
Open

Improved deprecation notes #1451

troelsfr opened this issue May 31, 2022 · 0 comments
Labels
area: diagnostics The Q# compiler's error reporting mechanism enhancement New request or suggestion for an improvement

Comments

@troelsfr
Copy link
Contributor

Is your feature request related to a problem? Please describe.
Deprecation notes can at times be difficult to understand. For instance, warning QS3308: Deprecated syntax. Use [] to construct an empty array, or [x, size = n] to construct an array of x repeated n times. is difficult to understand if you do not know what is meant by Use []. This deprecation warning arises when using

let x = new Int[256];

Describe the solution you'd like
My prefer solution would be to explicitly write the update statement. For instance, a warning could look like:

warning QS3308: Deprecated syntax:
   mutable arr = new Int[256]; 

Use [x, size = n] to construct an array of x repeated n times.
  mutable arr = [0, size= 256]; 

You can upgrade deprecated syntax automatically by running dotnet [args]

The message explicitly tells the user how to correct the in correct statement leaving out ambiguity and offering an automatic way to upgrade using the syntax formatter.

@troelsfr troelsfr added enhancement New request or suggestion for an improvement needs triage An initial review by a maintainer is needed labels May 31, 2022
@bettinaheim bettinaheim added area: diagnostics The Q# compiler's error reporting mechanism and removed needs triage An initial review by a maintainer is needed labels Jun 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: diagnostics The Q# compiler's error reporting mechanism enhancement New request or suggestion for an improvement
Projects
None yet
Development

No branches or pull requests

2 participants