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
+31Lines changed: 31 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,6 +16,37 @@
16
16
and prevents publishing packages with empty modules to Hex.
17
17
([Vitor Souza](https://github.com/vit0rr))
18
18
19
+
- Type inference now preserves generic type parameters when constructors or functions are used without explicit annotations, eliminating false errors in mutually recursive code:
20
+
```gleam
21
+
type Test(a) {
22
+
Test(a)
23
+
}
24
+
25
+
fn it(value: Test(a)) {
26
+
it2(value)
27
+
}
28
+
29
+
fn it2(value: Test(a)) -> Test(a) {
30
+
it(value)
31
+
}
32
+
```
33
+
Previously this could fail with an incorrect "Type mismatch" error:
34
+
```
35
+
Type mismatch
36
+
37
+
The type of this returned value doesn't match the return type
38
+
annotation of this function.
39
+
40
+
Expected type:
41
+
42
+
Test(a)
43
+
44
+
Found type:
45
+
46
+
Test(a)
47
+
```
48
+
([Adi Salimgereyev](https://github.com/abs0luty))
49
+
19
50
### Build tool
20
51
21
52
- 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