Fix more code that Kotlin 2.5 warns about
Categories
(Firefox for Android :: General, task)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox162 | --- | fixed |
People
(Reporter: RyanVM, Assigned: RyanVM)
Details
Attachments
(5 external files)
Found while testing Kotlin 2.5.0-RC: its return value checker flags ignored results of Kotlin standard library calls, which fails our -Werror Android builds. All of the affected code is valid on the current Kotlin 2.4.21, so it can be fixed ahead of the Kotlin update.
Several of the flagged calls were checks that never took effect. SearchEngineWriterTest and MarsSpocsEndpointRawTest computed contains() results without asserting them, and the SearchEngineWriterTest expectation turns out to be wrong. BundleTest called Array.plus(), which returns a new array, so its "expected and unexpected elements" cases never contained an unexpected element. The Fenix BrowserToolbarMiddlewareTest helper called asReversed() without using the result, so it never modeled the reversed tab counter menu of the bottom toolbar.
Comment 1•15 days ago
|
||
The Bugbug bot thinks this bug should belong to the 'Firefox for Android::Toolbar' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
| Assignee | ||
Updated•15 days ago
|
| Assignee | ||
Comment 2•15 days ago
|
||
| Assignee | ||
Comment 3•15 days ago
|
||
Kotlin 2.5 warns when a call relies on a default parameter value whose type is missing from the classpath:
createTab in the feature-listentopage tests, and the dataprotect and firefox-relay samples.
| Assignee | ||
Comment 4•15 days ago
|
||
Discarded results of collection transforms and nullable-Unit lambdas become forEach calls or plain Unit types,
test checks whose result was dropped become assertions, and Mockito stubbing/verification calls suppress
RETURN_VALUE_NOT_USED. SearchEngineWriterTest now matches the result URLs the writer actually emits.
| Assignee | ||
Comment 5•15 days ago
|
||
The toolbar test helper now reverses the tab counter menu for the bottom toolbar like production does. The
onboarding spacers are now emitted only on non-small layouts, as their ignored takeIf intended; nothing
changes visually, since the small-layout pager already fills the column.
| Assignee | ||
Comment 6•15 days ago
|
||
Comment 10•13 days ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/8a381f5bbb71
https://hg.mozilla.org/mozilla-central/rev/1d835d97f41d
https://hg.mozilla.org/mozilla-central/rev/9a4b1d7d8490
https://hg.mozilla.org/mozilla-central/rev/07b40d30d922
https://hg.mozilla.org/mozilla-central/rev/6f36b1092e49
https://hg.mozilla.org/mozilla-central/rev/8e9281852055
https://hg.mozilla.org/mozilla-central/rev/09c47e7480de
Description
•