Skip to content

Incorrect warn on useless comparisons #5001

@vat78

Description

@vat78

hello!
I've started lerning gleam on https://tour.gleam.run/basics/number-formats/
And I faced with inconsistency of echo result and warning when I wrote:

pub fn main() {
  // Scientific notation Float literals
  echo  7.0e2 == 700.0
}

the output is:

src/main.gleam:3
True
warning: Redundant comparison
  ┌─ /src/main.gleam:3:9
  │
3 │   echo  7.0e2 == 700.0
  │         ^^^^^^^^^^^^^^ This is always `False`

This comparison is redundant since it always fails.

Why does warning say 'false', if the echo prints 'true'?

Metadata

Metadata

Assignees

No one assigned

    Labels

    discussionThe approach has not yet been decidedhelp wantedContributions encouraged

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions