Skip to content

Add valueOrRethrow to Result#969

Open
natebosch wants to merge 3 commits into
mainfrom
value-or-rethrow
Open

Add valueOrRethrow to Result#969
natebosch wants to merge 3 commits into
mainfrom
value-or-rethrow

Conversation

@natebosch

Copy link
Copy Markdown
Member

This is the synchronous version of asFuture. Typical uses of Result
are asynchronous and the asFuture API is sufficient, but we already
have the APIs available for checking isValue and reading the value
with .asValue?.value so a synchronous counterpart is easy to
implement.

This is the synchronous version of `asFuture`. Typical uses of `Result`
are asynchronous and the `asFuture` API is sufficient, but we already
have the APIs available for checking `isValue` and reading the value
with `.asValue?.value` so a synchronous counterpart is easy to
implement.
@natebosch natebosch requested a review from a team as a code owner July 9, 2026 22:06
@natebosch natebosch requested a review from lrhn July 9, 2026 22:06
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

PR Health

Unused Dependencies ✔️
Package Status
async ✔️ All dependencies utilized correctly.

For details on how to fix these, see dependency_validator.

This check can be disabled by tagging the PR with skip-unused-dependencies-check.

Breaking changes ✔️
Package Change Current Version New Version Needed Version Looking good?
async Breaking 2.13.1 2.14.0-wip 2.14.0-wip ✔️

This check can be disabled by tagging the PR with skip-breaking-check.

API leaks ✔️

The following packages contain symbols visible in the public API, but not exported by the library. Export these symbols or remove them from your publicly visible API.

Package Leaked API symbol Leaking sources

This check can be disabled by tagging the PR with skip-leaking-check.

Changelog Entry ✔️
Package Changed Files

Changes to files need to be accounted for in their respective changelogs.

This check can be disabled by tagging the PR with skip-changelog-check.

Coverage ✔️
File Coverage
pkgs/async/lib/src/result/error.dart 💚 88 % ⬆️ 1 %
pkgs/async/lib/src/result/result.dart 💚 84 %
pkgs/async/lib/src/result/value.dart 💚 82 % ⬆️ 3 %

This check for test coverage is informational (issues shown here will not fail the PR).

This check can be disabled by tagging the PR with skip-coverage-check.

License Headers ✔️
// Copyright (c) 2026, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
Files
no missing headers

All source files should start with a license header.

Unrelated files missing license headers
Files
pkgs/collection/benchmark/legacy_quicksort.dart

This check can be disabled by tagging the PR with skip-license-check.

@natebosch

Copy link
Copy Markdown
Member Author

We could also write this as an extension getter easily, but I think that these classes were not designed to be extended and it may be worth the potentially breaking change to mark them final. If something comes up in internal usage we may want to rethink this plan, but hopefully no one will have used these as mocks or anything like that.

#970

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant