Skip to content

v0.15.1 - Error Propagation Milestone

Choose a tag to compare

@oisee oisee released this 17 Dec 21:05
· 1755 commits to main since this release

Error Propagation Milestone

This release marks a significant milestone: the @error(code) metafunction is now fully working!

Key Features

  • @error(code) metafunction - Sets CY flag and returns with error code
  • Proper Z80 code generation - Generates SCF (Set Carry Flag) instruction
  • CY flag + A register ABI - Complete error handling ABI

Example

enum FileError { None, NotFound, Permission }

fun read_file?(path: u8) -> u8 ? FileError {
    if path == 0 {
        @error(1);  // FileError.NotFound - sets CY flag
    }
    return path;
}

Generated Z80 Assembly

LD A, D          ; Load error code
SCF              ; Set carry flag (error indicator)
RET              ; Return with error

Metrics

  • Compilation rate: 81% (48/59 examples)
  • No regressions from previous release

Documentation

What's Next

  • Enum value access (ErrorType.Value syntax)
  • ?? @error propagation syntax cleanup
  • Type inference for ?-suffixed function calls

Full Changelog: v0.9.7...v0.15.1