Skip to content

AND-221: fix ResultFlow polymorphism#64

Open
TopHlop wants to merge 1 commit into
mainfrom
fix/AND-221-result-flow
Open

AND-221: fix ResultFlow polymorphism#64
TopHlop wants to merge 1 commit into
mainfrom
fix/AND-221-result-flow

Conversation

@TopHlop
Copy link
Copy Markdown

@TopHlop TopHlop commented Apr 13, 2026

No description provided.

@TopHlop TopHlop requested review from osipxd and sWift-sai April 13, 2026 22:54
* @see flow
*/
@JvmName("resultFlowResult")
public fun <T> resultFlow(block: suspend () -> Result<T>): Flow<Result<T>> {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of removing this signature we could add @Deprecated(DeprecationLevel.HIDDEN) this way already compiled code will still work with new version of the library

"or use `flow { emit(block()) }` to emit the Result as-is.",
level = DeprecationLevel.ERROR,
)
@JvmName("-resultFlowResultDoubleWrap")
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternatively @JvmSynthetic could be applied to make the function invisible from Java.

* @see flow
* @see toResultFlow
*/
public fun <T> resultFlow(block: suspend () -> T): Flow<Result<T>> {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Btw, can't inline + crossinline be used here?

@sWift-sai sWift-sai requested review from AleksandrTabolin and removed request for sWift-sai April 20, 2026 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants