Build error : FakeNewsViewModel.kt: (46, 13): @exhaustive when is not exhaustive
See original GitHub issueOverview (Required)
- Build error : FakeNewsViewModel.kt: (46, 13): @Exhaustive when is not exhaustive
Steps To Reproduce
- Check out repository which version is 393f8ab57b8fdedee1c7c3393f50a61eb75bc543 2021/02/28 10:33:52
- Build
- Build will be failed. The messeage is bellow.
conference-app-2021\compose-uicomponent\src\main\java\io\github\droidkaigi\confsched2021\news\ui\news\FakeNewsViewModel.kt: (46, 13): @Exhaustive when is not exhaustive!
Expected behavior
- Build success.
- When I added following place holder, Build was succeded.
is NewsViewModel.Event.OnHideSnackbarMessage -> {
}
Screenshots
- N/A
Env:
- Android Studio Arctic Fox | 2020.3.1 Canary 8
- Build AI-0203.7148.57.2031.7165533, build on February 24, 2021
- Runtime version: 11.08+10-b944.6842174 amd64
- VM: OpenJDK 64-Bit Server VM by N/A
Additional context
- N/A
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Support sealed (exhaustive) whens : KT-12380
Sealed whens can never have else branch and must be exhaustive (otherwise compiler error is reported in both cases). In bytecode, exception is...
Read more >How to fix "Non exhaustive 'when' statements on sealed class ...
But I get a warning (in Kotlin 1.7 I guess it will be an error), saying: Non exhaustive 'when' statements on sealed class/interface...
Read more >TIL: when is “when” exhaustive? - ProAndroidDev
“when” block being assigned to a value as an expression, with error telling us to add the remaining branches or an “else” branch....
Read more >Exhaustiveness of When Statements | Java to Kotlin
In Kotlin 1.7 onwards a non-exhaustive when statement will be a compile-time error, and we will not need the exhaustive extension any more....
Read more >if/then/else vs. non-exhaustive when: what is the right approach?
The main idea behind exhaustive whens is that you will get a compiler error at the use site when new enum values are...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You are right.
I checked out the latest version again (28b8fc89d750b8b8a2e987b02450e52bdc37da06 2021/02/28 11:50:06), There is nothing problem.
Probably this issue was cause by my mistakes…
Thank you for tryng!!🙌