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
@@ -34,6 +34,37 @@
34
34
than stopping at the syntax error.
35
35
([mxtthias](https://github.com/mxtthias))
36
36
37
+
- Type inference now preserves generic type parameters when constructors or functions are used without explicit annotations, eliminating false errors in mutually recursive code:
38
+
```gleam
39
+
type Test(a) {
40
+
Test(a)
41
+
}
42
+
43
+
fn it(value: Test(a)) {
44
+
it2(value)
45
+
}
46
+
47
+
fn it2(value: Test(a)) -> Test(a) {
48
+
it(value)
49
+
}
50
+
```
51
+
Previously this could fail with an incorrect "Type mismatch" error:
52
+
```
53
+
Type mismatch
54
+
55
+
The type of this returned value doesn't match the return type
56
+
annotation of this function.
57
+
58
+
Expected type:
59
+
60
+
Test(a)
61
+
62
+
Found type:
63
+
64
+
Test(a)
65
+
```
66
+
([Adi Salimgereyev](https://github.com/abs0luty))
67
+
37
68
### Build tool
38
69
39
70
- 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