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

Improved deprecation notes #1451

Open
Open
@troelsfr

Description

@troelsfr

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: diagnosticsThe Q# compiler's error reporting mechanismenhancementNew request or suggestion for an improvement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions