Skip to main content

Changelog

All notable changes to Nebra are listed here, newest first. Entries under Breaking can make code that compiled before report errors; they are listed first so you can check them before upgrading.

0.5.24 (2026-11-10)​

Breaking​

  • An import of a module that runs on a side the importing file does not run on is an error under [sides], as it would fail at runtime on that side. import type stays allowed. (#231)
  • The variables of for ... in ipairs(t) and pairs(t) take the types of t, and values declared before a class are checked inside its fields, constructors and methods. Both were any, so code that was wrong can now report errors. (#236, #232)
  • nebra build removes what earlier builds left in the output directory; --no-clean keeps it. A directory that is not one of its own, such as the project root or one containing the sources, is left alone with a warning. (#230)

Added​

  • Runtime errors of nebra run and failures of nebra test, tracebacks included, name the .neb file and line instead of the generated Lua. (#238)
  • source_maps = true writes a .lua.map next to every generated file, mapping its lines to the .neb source, so a host can translate tracebacks. (#229)
  • Parameters of function types can be named, in any number: (entity: number, value: string?) -> nil. (#237)
  • contract declares a strict interface: a table with any other field is a type error, and fields can carry the rules @range, @integer, @length, @nonEmpty and @pattern, checked for literals at compile time and by is and match at runtime. (#234)

Fixed​

  • A method without a return type takes it from its body, like a function does, instead of reporting its return as returning a value from a function that returns nil. (#235)
  • Classes, interfaces and enums of one name in different files are different types. They used to be merged, so the members of one were accepted on the other, even with an explicit import. (#233)

0.5.23 (2026-11-09)​

Added​

  • import "models/*.neb" imports every matching file, like one side-effect import per file; ** reaches nested directories. (#228)
  • Completion and the import quick fix offer the exports of installed packages from nebra_modules/, as import { Model } from "nanos-orm", and the types of the other modules of a runtime_global package through import type. (#227)

Fixed​

  • The exports of other files are completed from the start of a word. A request sent before its first letter, such as after a space, left them out, and editors kept filtering that list, so they never appeared. (#227)
  • The import quick fix finds every exported declaration, such as export abstract class, and no longer suggests a file that only mentions the name in an export local line. Adding a name no longer merges it into an import type or export { } from line. (#227)

0.5.22 (2026-11-09)​

Added​

  • operator [] and operator []= work on classes created through @overrideInherit when the annotation names the methods of the host with index and newindex, so in nanos world they run as the index and newindex hooks of an inherited class. (#225)
  • The builtin annotation @overrideIs("template") lets a class decide how is, instanceof and type patterns test against it and the classes extending it, which in nanos world go through IsA. (#225)

0.5.21 (2026-11-09)​

Added​

  • The builtin annotation @overrideInherit("template") lets a declared class decide how classes extending it are created, for hosts with their own inheritance: such a class is created through the template, constructs through Constructor, reaches the host through self.Super and is spawned like its base. With it, class Crate extends Prop works in nanos world through Prop.Inherit. (#224)

0.5.20 (2026-11-05)​

Fixed​

  • Completion works in Zed and other clients that require a title on every command: functions completed as a call no longer send their command without one, which made Zed drop the whole list. (#223)

0.5.19 (2026-10-29)​

Added​

  • The utility types Partial, Required, Pick and Omit are declared in the standard library with the new declare type Name<T> form, so they are completed, hovered and documented. (#221)
  • Completion knows where a type is written: after :, ->, extends, implements, keyof, as and is, inside type arguments, unions and function types it offers only types and keyof, and completes a generic type with its type argument list. (#221)
  • The keys of Pick<User, |>, Omit<User, |> and User[|] complete as the field names of User, and a value whose type takes literals, such as keyof Events or "fill" | "line", completes with those literals first, also inside a string being typed. (#221)
  • The code between the braces of an interpolated string is highlighted like code, and completes values, members and the keywords an expression can use; the text around it completes nothing. (#222)

Fixed​

  • Hover, go to definition and diagnostics find the code inside an interpolated string, which used to be placed at the start of the file. (#222)
  • sealed, keyof, try, catch and finally are highlighted as keywords, also after a : in a type annotation, while a keyword used as a member name, such as promise:catch(...), is highlighted as a plain name. (#219)
  • A file of the standard library opened from the compiler's sources, such as stdlib/test.d.neb, takes the place of its embedded copy instead of declaring its names twice, and hovering a declare module shows the module with its members. (#220)

0.5.18 (2026-10-28)​

Added​

  • function a.b(...) takes the types of unannotated parameters from the field b, like an assignment of a function literal does, so function love.update(dt) types dt. (#215)

Fixed​

  • A package published since the registry index was cached is found right away: a name the cached index does not have refreshes it. (#217)
  • function T:method(...) declares self, typed as T, and takes the types of its parameters from the member method of T; a parameter named like a type no longer hides the type in its annotation; a declared class needs no super() call. (#216)
  • An overload taking a union of literals, such as mode: "fill" | "line", is picked for a literal argument, and a call no overload takes is reported with the overloads there are. (#214)

0.5.17 (2026-10-28)​

Added​

  • A declare interface whose name is already declared as an interface adds its members to it, so a declaration file can extend an interface another one declares, such as the standard library's MathLib. (#213)

Fixed​

  • A missing member of an interface or enum is reported as such instead of as a type that cannot be indexed. (#213)

0.5.16 (2026-10-28)​

Breaking​

  • try, catch and finally are keywords and can no longer name a variable or function; they still work as member names, such as promise:catch(...). (#181)

Added​

  • Utility types Partial<T>, Required<T>, Pick<T, K> and Omit<T, K> make a struct type from the fields of a struct, class or interface. (#210)
  • Completion puts what fits the expected type first: the members of an expected enum as the shorthand, then values and functions of that type, in an annotated local, an argument, an assignment, a return, a comparison, a match case and a field or element of a table literal. (#211)
  • target = "luajit" is accepted as another name for "jit". (#209)
  • try ... catch (err) ... finally ... end. A return inside try or catch returns from the enclosing function, try without catch raises the error again after finally, and a bare try ... end ignores it. (#181)
  • A member of an enum may be written without the enum where a value of that enum is expected: local color: Color = Red, as an argument, in an assignment, a return, a comparison, a match case or a table field. (#165)
  • A class may declare several constructors with different parameter types. new and super(...) pick the one the arguments fit, at compile time where it is known and through new at runtime otherwise. (#182)

Fixed​

  • An empty table literal fits a struct type whose fields are all optional, and a missing field of a struct is reported with the fields it has. (#210)
  • A half-written case of a match no longer drops the whole file from the language server, which left it without completion, hover and diagnostics. (#211)
  • A nebra.toml that cannot be read, such as one with an unknown target, stops the build instead of building with every setting at its default. (#209)

0.5.15 (2026-10-27)​

Breaking​

  • The members of a generic class or interface now have the type arguments of the instantiation they are used through, so a mismatch such as local name: string = new Box(1).value is an error where the erased T let it pass before. (#204)

Added​

  • Generic classes and interfaces are fully substituted: each instantiation such as Box<number> has its type arguments filled into its fields, methods, getters, operators, base class and interfaces, new infers them from the constructor's arguments, and an instantiation fits another of the same class when its type arguments do. (#204)
  • is and instanceof against an instantiation, such as value is Box<number>, compare the type arguments at runtime. A generic class without type arguments, value is Box, matches every instantiation. (#204)
  • Generated declaration files keep type parameters with their bounds and the type arguments of extends and implements. (#203)
  • Literal types such as "fast" | "slow", 1 | 2 and true, keyof T and indexed access types T[K], so an event map types each callback by the name it is registered under. Interface and struct fields may be named by a string such as "user:login". (#206)
  • A function literal without parameter annotations takes its parameter types from the function type it is passed or assigned to. (#207)

Fixed​

  • A generic method implementing a generic interface method is compared with it key by key, a union fits a union holding each of its members, and errors in code an annotation generates point at the annotation. (#208)
  • nebra test no longer hangs when a test directory contains a link back to the project, such as a fixture's nebra_modules/ linking to the package it tests. The CLI walks directories like the language server does, without following directory links or entering nebra_modules/, and test discovery skips nested projects that have their own nebra.toml. (#205)

0.5.14 (2026-10-27)​

Breaking​

  • A generic class or interface used without its type arguments, such as Box instead of Box<number>, is an error, in annotations as well as in extends and implements. (#190)
  • Inside the body of a generic function, class, method or interface default, a type parameter only accepts a value of itself and fits only what its bounds fit, so local value: T = 0 or a + b on unbounded T values are errors. Call sites still infer type parameters as before. (#177)
  • Member names Nebra reserves are errors: the metamethods operator declares (__add, __eq, __len, ...), __index, __newindex, __name, __interfaces, __metatable and names starting with __nebra, __get_, __set_, __op_ or __ext_. __tostring, __close, __gc, __pairs and __call stay allowed. (#198, #187)
  • A class written in Nebra, its constructor and its methods cannot be replaced from outside (A = ..., function A.new() end). (#201)
  • A second constructor in a class is an error instead of silently replacing the first. (#185)
  • super() outside a derived class's constructor is an error instead of producing invalid Lua. (#194)
  • Two unrelated interface defaults for the same method must be resolved by overriding it in the class. (#188)
  • Operators, constructors and getters/setters cannot declare type parameters, and operators other than () cannot declare several return values. (#199, #200)
  • A getter takes no parameters, a setter exactly one, and a property with only a setter cannot be read. (#177)

Added​

  • Code that runs while a file loads and reaches a class, function or extend block defined further down the same file is an error, including class B extends A above A, which left B without A's methods. (#154)
  • Under strict_nil, an instance field whose type does not allow nil must be initialized by a default value or on every path of the constructor. (#186)
  • sealed class prevents a class from being extended. (#180)
  • local constructor limits creating instances to the class itself, for factories and singletons. (#173)
  • A warning for an extension that is never used because the extended type has a member of the same name. (#189)

Changed​

  • Expressions made only of literals are computed while compiling and written as their result, with Lua's integer and float semantics. (#19)
  • A derived class whose constructor only creates the base instance compiles to a single return setmetatable(Base.new(...), Class), and ... is forwarded only when the inherited constructor takes parameters. (#195)
  • A subclass copies only the metamethods its base classes actually declare; the copying loop is left out when there are none. (#192)

Fixed​

  • A subclass keeps __tostring, __call, __close and __pairs declared as methods on its base class; before, only operator metamethods were carried over. (#192)
  • The named varargs example in the documentation uses the named parameter. (#169)
  • Warnings of a successful build are printed. (#202)
  • A constructor ending in varargs accepts any number of further arguments. (#197)
  • Loop variables take the types the iterator returns, so for _, v in next, values no longer types v as possibly nil. (#171)
  • A table keyed by numbers, such as { [1] = n }, fits an array type. (#179)

0.5.13 (2026-10-25)​

Fixed​

  • Packages from a repository subdirectory are installed without the subdirectory's prefix and under a store path of their own, so their nebra.toml and dependencies are read again. (#164)

0.5.12 (2026-10-25)​

Fixed​

  • A class operator picks the overload whose parameter takes the right operand, and reports operands no overload takes. (#162)
  • A class operator taking a string wins over string concatenation, in type checking and in the generated Lua. (#163)

0.5.11 (2026-10-25)​

Added​

  • Index, index assignment and call operators (operator [], operator []=, operator ()) for classes and extensions. (#158)

Fixed​

  • An optional function type no longer shares its key with a function returning an optional value, which crashed the compiler. (#160)
  • Table literals fit struct types and interfaces by their fields; fields typed T? may be left out. (#161)
  • A subclass with getters but no constructor of its own keeps its getters and inherited methods. (#159)

0.5.10 (2026-10-20)​

Breaking​

  • .. between two numbers is an inclusive range instead of a concatenation; 1. is no longer a number literal. (#153)
  • Extensions are local to their module; export extend shares them with importing modules. (#149)

Added​

  • Getters, operators and export extend for type extensions, and member access on number literals such as 1.hour. (#149)

Fixed​

  • Overloads of the same arity are told apart by their parameter types, the known overload is called directly, and duplicate signatures are reported. (#150, #151, #152)

0.5.9 (2026-10-17)​

Added​

  • super:method() calls the overridden method of the base class. (#148)
  • Type arguments of generic calls are inferred, and bounded type parameters get the members of their bounds. (#145)
  • nebra publish, unpublish, scope and login for the package registry. (#135, #136, #137)
  • import_path = "root" writes imports of own modules as their path from the output root. (#133)
  • Packages load through a runtime global, and export { ... } from re-exports names. (#127)
  • Type imports may form cycles, top-level classes and local functions are hoisted, and loops iterate values through their iterator() method. (#124, #125, #126, #130)
  • nebra create from local setup scripts and template directories.

Fixed​

  • defer works like Go: arguments are evaluated when reached, each loop pass defers its own call and deferred calls run on errors. (#134)
  • Local dependencies skip links, nested projects and build output when hashed and loaded. (#146, #147)
  • Further fixes for map types, method scopes, deep annotation targets, keyword method names, syntax errors in imported modules, while narrowing, empty table arguments, from and operator as contextual keywords, untyped locals, class annotations and async errors. (#122–#144)