-
Notifications
You must be signed in to change notification settings - Fork 745
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Optionally recommend against static import of
Truth8.assertThat
.
The methods there will be moving into the main `Truth` class. Users will have various options for how to migrate, but one option involves avoiding static imports. We will provide more instructions as part of our Truth releases. (See, e.g., [the release notes for Truth 1.3.0](https://github.com/google/truth/releases/tag/v1.3.0).) Rough outline of the option that involves avoiding static imports: - The problem with adding `Truth8.assertThat(OptionalInt)` (or a similar overload) to `Truth` is that anyone who static imports both `Truth.assertThat` and `Truth8.assertThat` will see ambiguity errors if they use that method. - The solution is to stop using static import for `Truth8.assertThat`. Once all its static imports are gone, we can add the new methods to `Truth` without breaking anyone, and then we can migrate users. - Avoiding static import for `Truth8.assertThat` would be tough to swallow for the most common types, `Stream` and `Optional`. Luckily, I found an alternative approach that works for those, as discussed in the linked release notes. (That approach works for those types because they're generic types.) PiperOrigin-RevId: 601232868
- Loading branch information
Showing
2 changed files
with
71 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters