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

fix: when expression must be exhaustive by adding else branch #113

Merged
merged 1 commit into from
Jan 30, 2023

Conversation

hurali97
Copy link
Contributor

@hurali97 hurali97 commented Dec 8, 2022

Fixes issue #106

Description of changes:

In Kotlin 1.6.0, non-exhaustive when was marked as a compile-time warning, if used as a statement. In 1.7.0, a compile-time error is thrown to make this behaviour consistent with when expressions. More info here

For our use case, we added an empty else branch to the when statement on Player.State.

To test this, add kotlinVersion= "1.7.0" to android/build.gradle to the example project, like so:

buildscript {
    ext {
        buildToolsVersion = "30.0.2"
        minSdkVersion = 21
        compileSdkVersion = 30
        targetSdkVersion = 30
        ndkVersion = "21.4.7075529"
        kotlinVersion= "1.7.0"
    }
 // ...other stuff
}

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@maxstoller
Copy link
Contributor

@alexmdodge @david-pw Should this be merged? Thanks!

Copy link
Contributor

@dawhitla dawhitla left a comment

Choose a reason for hiding this comment

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

Let's go ahead and get this merged @maxstoller

@dawhitla dawhitla merged commit 87e553f into aws:main Jan 30, 2023
dongchan0321 added a commit to NeyberTech/amazon-ivs-react-native-player that referenced this pull request Jan 31, 2023
@dawhitla dawhitla mentioned this pull request Jul 17, 2023
@dawhitla dawhitla mentioned this pull request Aug 16, 2023
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