• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

forst-lang / forst / 24314986808
76%

Build:
DEFAULT BRANCH: main
Ran 12 Apr 2026 07:52PM UTC
Jobs 1
Files 193
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

12 Apr 2026 07:48PM UTC coverage: 62.993% (+0.1%) from 62.887%
24314986808

push

github

haveyaseen
fix(typechecker): narrow Result ensure blocks to the failure branch

`ensure x is Ok() { ... }` / `Err()` now refines the subject inside the block to
the payload type that matches the generated `if !(ok)` branch (F after Ok, S
after Err), then applies successor narrowing for the passing path. Adds
`Ok()`/`Err()` method typing and completion on built-in `Result(S, F)`.

Example:

```forst
x := f()
ensure x is Ok() {
  println(x) // failure payload while Ok() is false
}
println(x.Ok())
```

fix(transformer): map narrowed Result locals to split Go names

When a Result binding is narrowed out of `Result` form, plain references and
`x.Ok()`/`x.Err()` calls target the correct success/error Go identifiers;
`println` expands only while the binding is still a full Result. Restores the
ensure block scope before lowering the failure body so narrowing matches the
typechecker.

feat(lsp): qualify guard hovers using the inferred subject type

Guard identifiers after `is` use `InferredTypesForVariableIdentifier` so hovers
show titles like `Int.GreaterThan` instead of only the bare guard name.

Example:

```forst
ensure n is GreaterThan(0)
```

fix(printer): format `ensure` error alternatives and nested statement indentation

Prints `or` clauses on their own indented line; avoids double-indenting
statements that already embed nested block layout.

feat(vscode-forst): highlight nominal `error Name` and core builtin types

Adds a pattern for `error Name { ... }`, treats `error` as a declaration
keyword, classifies `Error`/`Result`/`Tuple`, and highlights `true`/`false`.

test: extend Result narrowing, LSP hover, and typechecker coverage

Updates `examples/in/ensure.ft` and golden `ensure.go` for the Result-based flow.

139 of 192 new or added lines in 10 files covered. (72.4%)

8 existing lines in 2 files now uncovered.

16792 of 26657 relevant lines covered (62.99%)

20.45 hits per line

Uncovered Changes

Lines Coverage ∆ File
16
82.91
-10.94% forst/internal/transformer/go/result_local.go
10
74.93
-0.34% forst/cmd/forst/lsp/hover_completion.go
9
69.06
-0.09% forst/internal/typechecker/narrow_if.go
5
80.77
-19.23% forst/internal/hoverdoc/guards.go
5
23.26
-0.49% forst/internal/typechecker/completion.go
4
67.88
3.27% forst/internal/printer/printer.go
2
55.24
-0.06% forst/internal/transformer/go/statement.go
2
63.78
0.35% forst/internal/typechecker/infer_expression.go

Coverage Regressions

Lines Coverage ∆ File
6
32.29
-1.11% forst/internal/transformer/go/shape.go
2
67.88
3.27% forst/internal/printer/printer.go
Subprojects
ID Flag name Job ID Ran Files Coverage
1 /jobs/180152136 24314986808.1 12 Apr 2026 07:52PM UTC 193
62.99
GitHub Action Run
Source Files on build 24314986808
  • Tree
  • List 193
  • Changed 11
  • Source Changed 0
  • Coverage Changed 11
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 3d47e0fa on github
  • Prev Build on main (#24313529117)
  • Next Build on main (#24315038891)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc