Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

lint of unnecessary parentheses around if condition may case error #63156

Closed

Description

@bravomikekilo

when unnecessary parentheses is removed, may lack a whitespace between if and expr.

example
if(is_prime) {println!("hello")};
while be replaced to
ifis_prime {println!("hello")};

Maybe we should replare (expr) with a pair of whitespace around expr, instead of just expr;

Activity

  1. added
    A-diagnostics
    C-bug
    E-easy
    on Jul 31, 2019
  2. bravomikekilo commented on Jul 31, 2019

    @bravomikekilo
    ContributorAuthor

    I am working on it.

  3. added
    T-compiler
    A-lints
    and removed
    A-diagnostics
    on Jul 31, 2019
  4. added a commit that references this issue on Aug 6, 2019
  5. solyasa commented on Apr 23, 2024

    @solyasa

    Previous code
    if (fee > 4) {
    stake_pool.fee = 4;
    } else {
    stake_pool.fee = fee;
    }

    Updated code

    if fee > 4 {
    stake_pool.fee = 4;
    } else {
    stake_pool.fee = fee;
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lintsC-bugE-easyT-compiler

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions