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
+34-6
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ At the moment, Elixir developers will interact with set-theoretic types only thr
12
12
13
13
*`atom()` - it represents all atoms and it is divisible. For instance, the atom `:foo` and `:hello_world` are also valid (distinct) types.
14
14
15
-
*`map()` and structs - maps can be "closed" or "open". Closed maps only allow the specified allows keys, such as `%{key: atom(), value: integer()}`. Open maps support any other keys in addition to the ones listed and their definition starts with `...`, such as `%{..., key: atom(), value: integer()}`. Structs are closed maps with the `__struct__` key.
15
+
*`map()` and structs - maps can be "closed" or "open". Closed maps only allow the specified keys, such as `%{key: atom(), value: integer()}`. Open maps support any other keys in addition to the ones listed and their definition starts with `...`, such as `%{..., key: atom(), value: integer()}`. Structs are closed maps with the `__struct__` key.
16
16
17
17
*`tuple()`, `list()`, and `function()` - currently they are modelled as indivisible types. The next Elixir versions will also introduce fine-grained support to them.
18
18
@@ -28,19 +28,19 @@ We focused on atoms and maps on this initial release as they are respectively th
28
28
29
29
* Capturing a function on non-modules, such as `&user.address/0`
30
30
31
+
* Attempting to invoke to call an anonymous function without an actual function, such as `user.()`
32
+
31
33
* Performing structural comparisons with structs, such as `my_date < ~D[2010-04-17]`
32
34
33
35
* Performing structural comparisons between non-overlapping types, such as `integer >= string`
34
36
35
-
* Building and pattern matching on binaries without the relevant specifiers, such as `<<string>>` (this warns because by default it expects an integer)
37
+
* Building and pattern matching on binaries without the relevant specifiers, such as `<<name>>` (this warns because by default it expects an integer, it should have been `<<name::binary>>` instead)
36
38
37
-
* Attempting to rescue an undefined exception or an exception that is not a struct
39
+
* Attempting to rescue an undefined exception or a struct that is not an exception
38
40
39
41
* Accessing a field that is not defined in a rescued exception
40
42
41
-
These new warnings help Elixir developers find bugs earlier and give more confidence when refactoring code, especially around maps and structs. While some of these warnings were emitted in the past, they were discovered using syntax analysis. The new warnings are more reliable, precise, and with better error messages. Keep in mind that not all maps have statically known keys, and the Elixir typechecker at the moment only infers types from patterns within the same function.
42
-
43
-
Future Elixir versions will infer and type check more constructs, bringing Elixir developers more warnings and quality of life improvements without changes to code. For more details, see our new [reference document on gradual set-theoretic types](https://hexdocs.pm/elixir/main/gradual-set-theoretic-types.html).
43
+
These new warnings help Elixir developers find bugs earlier and give more confidence when refactoring code, especially around maps and structs. While some of these warnings were emitted in the past, they were discovered using syntax analysis. The new warnings are more reliable, precise, and with better error messages. Keep in mind, however, that the Elixir typechecker only infers types from patterns within the same function at the moment. Analysis from guards and across function boundaries will be added in future relases. For more details, see our new [reference document on gradual set-theoretic types](https://hexdocs.pm/elixir/main/gradual-set-theoretic-types.html).
44
44
45
45
The type system was made possible thanks to a partnership between [CNRS](https://www.cnrs.fr/) and [Remote](https://remote.com/). The development work is currently sponsored by [Fresha](https://www.fresha.com/), [Starfish*](https://starfish.team/), and [Dashbit](https://dashbit.co/).
46
46
@@ -72,6 +72,34 @@ Finally, a new `Kernel.to_timeout/1` function has been added, which helps develo
0 commit comments