|
| 1 | +# 0.14.0 |
| 2 | + |
| 3 | +2022-08-09 |
| 4 | + |
| 5 | +It's been a year! It was good to let the language sit for a while and |
| 6 | +see what kind of feedback we get from real world usage. This has also been |
| 7 | +an opportunity to get bug reports and fixes in, to help further stabilize |
| 8 | +the compiler. |
| 9 | + |
| 10 | +This release features commits by Li Jin, Enrique García Cota, Patrick |
| 11 | +Desaulniers, Mark Tulley, Corey Williamson, @Koeng101 and Hisham Muhammad. |
| 12 | + |
| 13 | +## What's New |
| 14 | + |
| 15 | +### Language |
| 16 | + |
| 17 | +* Global functions now require `global function`, you can no longer |
| 18 | + declare them with a bare `function`; this makes it more consistent |
| 19 | + with other global variables. (#500) |
| 20 | +* Forward references for global types: |
| 21 | + * `global type Name` can be used to forward-declare a type and |
| 22 | + use it, for example, in record fields, even if it is declared |
| 23 | + in another file. (#534) |
| 24 | +* Polymorphic functions (as declared in record methods) can be used |
| 25 | + as iterators for a generic `for`. (#525) |
| 26 | +* You can no longer define a global with the same name as a local which |
| 27 | + is already in scope. (#545) |
| 28 | +* Initial support for the `__index` metamethod: you can declare it |
| 29 | + as a function. (#541) |
| 30 | +* Dropped support for the old backtick syntax for type variables. |
| 31 | +* Type checker checks validity of Lua 5.4 `<close>` annotations: |
| 32 | + * the output target must be set to "5.4" |
| 33 | + * there can be only one `<close>` variable per declaration (to ensure |
| 34 | + correct order of `__close` metamethods being called) |
| 35 | + * the type of the variable is closable |
| 36 | + * globals can't be `<close>` |
| 37 | + * `<close>` variables can't be assigned to |
| 38 | +* Nested type arguments are now valid syntax without requiring a |
| 39 | + disambiguating space. The parser used to reject constructs of the |
| 40 | + type `X<Y<T>>` due to ambiguity with `>>`; it is now accepted |
| 41 | + (old time C++ coders will recall this same issue with C++98!) |
| 42 | +* Standard library improvements: |
| 43 | + * `math.maxinteger` and `max.mininteger` are always available |
| 44 | + (in any Lua version, with or without lua-compat-5.3 installed) |
| 45 | + |
| 46 | +### Code generation |
| 47 | + |
| 48 | +* Local types are now elided from generated code if they are never |
| 49 | + used in a concrete value context: if you declare a `local type T` |
| 50 | + such as a function alias, it no longer produces a `local T = {}` |
| 51 | + in the Lua output. |
| 52 | + |
| 53 | +### API |
| 54 | + |
| 55 | +* `tl.pretty_print_ast` now takes a `TargetMode` argument to specify |
| 56 | + flavor of Lua to produce in output: |
| 57 | + * new `TargetMode` for outputting Lua 5.4-specific code including |
| 58 | + `<const>` and `<close>` annotations. |
| 59 | +* `tl.load` now always runs the type checker, which is needed to produce |
| 60 | + type information required to output correct code in some cases. |
| 61 | + The default behavior, however, remains backwards compatible and |
| 62 | + allows code to run in the presence of type checking errors. |
| 63 | + You can override this behavior and make `tl.load` return `nil, err` |
| 64 | + in case of type checking errors by using a "c" prefix in the mode flag |
| 65 | + (e.g. "ct", "cb", "cbt"). |
| 66 | +* `tl.type_check` returns two values. |
| 67 | + |
| 68 | +### Tooling |
| 69 | + |
| 70 | +* Project CI now runs on GitHub Actions |
| 71 | +* Windows portability improvements |
| 72 | + * Windows and Mac now get tested regularly in the GitHub Actions CI! |
| 73 | +* New hint warning when the value of a function with multiple return values |
| 74 | + is being returned as part of an expression, causing the additional returns |
| 75 | + to be lost. |
| 76 | +* Improved error messages for map errors. |
| 77 | +* `tl check` avoids re-checking files already loaded in the environment: |
| 78 | + this allows you to check your `global_env_def` module without getting |
| 79 | + redeclaration errors. |
| 80 | +* Build script for stand-alone binary is now included in the repository. |
| 81 | + |
| 82 | +### Fixes |
| 83 | + |
| 84 | +* Fixed resolution of type variables to avoid clashes when nested uses |
| 85 | + of generic functions used the same type variable name. (#442) |
| 86 | +* Map index keys are checked nominally, not structurally. (#533) |
| 87 | +* Fixed flow checking of enums in `or`. (#487) |
| 88 | +* Properly return type errors for fields when comparing records. (#456) |
| 89 | +* Fixed a stack overflow when comparing unions with type variables. (#507) |
| 90 | +* Fixed a stack overflow in record comparisons. (#501) |
| 91 | +* It now reports the location of a redeclared record correctly. (#542) |
| 92 | +* Fixed resolution of nested type aliases (#527) and nested nominals (#499). |
| 93 | +* Fixed check of inconsistent record function declarations. (#517) |
| 94 | +* `tl.loader` reports correct filename in debug information. (#508) |
| 95 | +* Fixed error message when `tlconfig.lua` contains errors. |
| 96 | +* Tables can't be assigned to record types declared to be `userdata`. (#460) |
| 97 | +* Fix check of arrays of enums in overloaded record functions. |
| 98 | +* Fixed crash when attempting to declare a record method on an |
| 99 | + unknown variable. (#470) |
| 100 | + |
1 | 101 | # 0.13.2
|
2 | 102 |
|
3 | 103 | 2021-07-30
|
|
0 commit comments