-
-
Notifications
You must be signed in to change notification settings - Fork 888
Description
The language server incorrectly reports that comparing constructor functions is always True, when in reality such comparisons always evaluate to False.
Steps to reproduce:
type Comparison {
Wibble
Wobble(String)
}
pub fn main() {
echo Wibble == Wibble
echo Wobble == Wobble
}My IDE shows this warning message on both echo lines:
Redundant comparison
This is always `True`.
This comparison is redundant since it always succeeds.Running Gleam:
Compiling comparison
warning: Redundant comparison
┌─ /home/wiskiy/dev/gleamy/comparison/src/comparison.gleam:7:8
│
7 │ echo Wibble == Wibble
│ ^^^^^^^^^^^^^^^^ This is always `True`
This comparison is redundant since it always succeeds.
warning: Redundant comparison
┌─ /home/wiskiy/dev/gleamy/comparison/src/comparison.gleam:8:8
│
8 │ echo Wobble == Wobble
│ ^^^^^^^^^^^^^^^^ This is always `True`
This comparison is redundant since it always succeeds.
Compiled in 0.26s
Running comparison.main
src/comparison.gleam:7
True
src/comparison.gleam:8
FalseEnvironment:
- Gleam: v1.13.0
- OS: Arch Linux
- Runtime: Erlang
Metadata
Metadata
Assignees
Labels
No labels