Skip to content

avoid_init_to_null issue doesn't show when declared const #2417

@Acid-Free

Description

@Acid-Free

What happened?

When assigning null to a newly declared variable, avoid_init_to_null issue shows up in the bottom-right of the screen.
image
However, when declared as const, the issue disappears.

Steps to reproduce problem

  1. Define a constant variable [with const]

Additional info

Browser

Browser: firefox

Version: 107.0 (64-bit)

Are you using any extensions/plugins that affect website behavior
(particularly those that affect iframes, such as ad blockers)?

Are there any warnings or errors in your browser's JavaScript console?
If so, paste them below:

[paste warnings or errors here]

Machine

Operating system: Windows 10 Home Single Language

Version: 19044.2251

Code

main() {
  const int? a = null;
  print(a);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions