tooling/toolchainlib/src/platform/result.luau
Erica Marigold ead60c003e
refactor(lib): use extension pattern for result<->option
Formerly, we used metatables to get custom `Option` and `Result` objects
which were difficult to type properly, leading to a lot of `unknown` and
`any` casts.

This refactor fixes it by making extensions opt-in, where we import the
extension methods separately from the original implementations, thereby
allowing us to not have to typecast things everywhere.
2024-12-13 14:33:05 +00:00

7 lines
278 B
Text

local Result = require("../../lune_packages/result")
type Result<T, E> = Result.Result<T, E>
export type PlatformError = "NoPatternDetected" | "NoExecutableDetected" | "UnknownExecutableField"
export type PlatformResult<T> = Result<T, PlatformError>
return "<PlatformResult>"