Skip to content

Latest commit

 

History

History
87 lines (61 loc) · 2.21 KB

CHANGELOG.md

File metadata and controls

87 lines (61 loc) · 2.21 KB

Changelog

Unreleased

Compiler

  • Optimised code generated for record updates. (yoshi)

  • The compiler now allows for record updates to change the generic type parameters of the record:

    type Box(value) {
      Box(password: String, value: value)
    }
    
    fn insert(box: Box(a), value: b) -> Box(b) {
      Box(..box, value:)
    }

    (yoshi)

  • It is now allowed to write a block with no expressions. Like an empty function body, an empty block is considered incomplete as if it contained a todo expression. (Giacomo Cavalieri)

  • The shorthand names for the two targets, erl and js are now deprecated in code such as @target. (Surya Rose)

Build tool

  • Improved the error message you get when trying to add a package that doesn't exist with gleam add. (Giacomo Cavalieri)

Language Server

  • The language server now provides type information when hovering over argument labels. (Surya Rose)

  • The Language Server now suggests a code action to desugar a use expression into the equivalent function call. For example, this snippet of code:

    pub fn main() {
      use profile <- result.try(fetch_profile(user))
      render_welcome(user, profile)
    }

    Will be turned into:

    pub fn main() {
      result.try(fetch_profile(user), fn(profile) {
        render_welcome(user, profile)
      })
    }

    (Giacomo Cavalieri)

Formatter

Bug fixed

  • The compiler now throws an error when a float literal ends with an e and is missing an exponent. (Surya Rose)

  • Fixed a bug where the compiler would crash when pattern matching on multiple subjects and one of them being a constant record. (Surya Rose)

v1.6.1 - 2024-11-19

Bug fixed

  • Fixed a bug where gleam update would fail to update versions.