Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Makes BackStackScreen<*> practical #1121

Merged
merged 2 commits into from
Oct 17, 2023
Merged

Conversation

rjrjr
Copy link
Contributor

@rjrjr rjrjr commented Oct 16, 2023

Adds a few crucial out declarations to various Container and Wrapper types, so that declaring RenderingT types like BackStackScreen<*> is practical. Also required moving fun BackStackScreen.plus out to be an extension function.

Without these changes, this does not compile:

    val foo = BackStackScreen(FooScreen(1))
    val bar = BackStackScreen(BarScreen(1))
    val both = foo + bar

Instead we were forced to do things like:

    val foo: BackStackScreen<Screen> = BackStackScreen(FooScreen(1))
    val bar: BackStackScreen<Screen> = BackStackScreen(BarScreen(1))
    val both = foo + bar

It gets really old really fast.

@rjrjr rjrjr force-pushed the ray/tighten-up-backstack-types branch from a3c37ee to d1c5c4a Compare October 16, 2023 23:59
Adds a few crucial `out` declarations to various `Container` and `Wrapper` types, so that declaring `RenderingT` types like `BackStackScreen<*>` is practical. Also required moving `fun BackStackScreen.plus` out to be an extension function.

Without these changes, this does not compile:

```kotlin
    val foo = BackStackScreen(FooScreen(1))
    val bar = BackStackScreen(BarScreen(1))
    val both = foo + bar
```

Instead we were forced to do things like:

```kotlin
    val foo: BackStackScreen<Screen> = BackStackScreen(FooScreen(1))
    val bar: BackStackScreen<Screen> = BackStackScreen(BarScreen(1))
    val both = foo + bar
```

It gets really old really fast.
@rjrjr rjrjr force-pushed the ray/tighten-up-backstack-types branch from d1c5c4a to 927c038 Compare October 17, 2023 00:13
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@rjrjr rjrjr marked this pull request as ready for review October 17, 2023 00:35
@rjrjr rjrjr requested review from zach-klippenstein and a team as code owners October 17, 2023 00:35
@rjrjr rjrjr requested a review from wardellbagby October 17, 2023 16:35
@rjrjr rjrjr merged commit d352bb1 into main Oct 17, 2023
31 checks passed
@rjrjr rjrjr deleted the ray/tighten-up-backstack-types branch October 17, 2023 17:23
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.

3 participants