+24
CHANGELOG.md
+24
CHANGELOG.md
···
75
75
76
76
([Giacomo Cavalieri](https://github.com/giacomocavalieri))
77
77
78
+
- The compiler now raises a warning when performing a redundant comparison that
79
+
it can tell is always going to succeed or fail. For example, this piece of
80
+
code:
81
+
82
+
```gleam
83
+
pub fn find_line(lines) {
84
+
list.find(lines, fn(x) { x == x })
85
+
}
86
+
```
87
+
88
+
Would result in the following warning:
89
+
90
+
```
91
+
warning: Redundant comparison
92
+
┌─ /src/warning.gleam:2:17
93
+
│
94
+
1 │ list.find(lines, fn(x) { x == x })
95
+
│ ^^^^^^ This is always `True`
96
+
97
+
This comparison is redundant since it always succeeds.
98
+
```
99
+
100
+
([Giacomo Cavalieri](https://github.com/giacomocavalieri))
101
+
78
102
- When using two spreads, trying to concatenate lists, the compiler will now
79
103
show a nicer error message. For example, this snippet of code:
80
104