You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+32Lines changed: 32 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -120,6 +120,38 @@
120
120
121
121
([fruno](https://github.com/fruno-bulax/))
122
122
123
+
- Type inference now preserves generic type parameters when constructors or functions are used without explicit annotations, eliminating false errors in mutually recursive code:
124
+
```gleam
125
+
type Test(a) {
126
+
Test(a)
127
+
}
128
+
129
+
fn it(value: Test(a)) {
130
+
it2(value)
131
+
}
132
+
133
+
fn it2(value: Test(a)) -> Test(a) {
134
+
it(value)
135
+
}
136
+
```
137
+
Previously this could fail with an incorrect "Type mismatch" error:
138
+
```
139
+
Type mismatch
140
+
141
+
The type of this returned value doesn't match the return type
142
+
annotation of this function.
143
+
144
+
Expected type:
145
+
146
+
Test(a)
147
+
148
+
Found type:
149
+
150
+
Test(a)
151
+
```
152
+
153
+
([Adi Salimgereyev](https://github.com/abs0luty))
154
+
123
155
### Build tool
124
156
125
157
- The help text displayed by `gleam dev --help`, `gleam test --help`, and
Copy file name to clipboardExpand all lines: compiler-core/src/language_server/tests/snapshots/gleam_core__language_server__tests__action__type_variables_in_let_bindings_are_considered_when_adding_annotations.snap
0 commit comments