Minor. Add space after when
Co-authored-by: Louis CAD <louis.cognault@gmail.com>
This commit is contained in:
committed by
Ilmir Usmanov
parent
755b92b0e9
commit
9e4f234941
@@ -212,7 +212,7 @@ where function boundaries are represented by `==========` and state boundaries a
|
|||||||
the function generates the following code (simplified for now):
|
the function generates the following code (simplified for now):
|
||||||
```kotlin
|
```kotlin
|
||||||
val $result: Any? = null
|
val $result: Any? = null
|
||||||
when(this.label) {
|
when (this.label) {
|
||||||
0 -> {
|
0 -> {
|
||||||
this.label = 1
|
this.label = 1
|
||||||
$result = dummy(this)
|
$result = dummy(this)
|
||||||
@@ -418,7 +418,7 @@ The state-machine section touched upon the `$result` variable inside the `invoke
|
|||||||
function of `a`, but, unlike the previous example, with its signature:
|
function of `a`, but, unlike the previous example, with its signature:
|
||||||
```kotlin
|
```kotlin
|
||||||
fun invokeSuspend($result: Any?): Any? {
|
fun invokeSuspend($result: Any?): Any? {
|
||||||
when(this.label) {
|
when (this.label) {
|
||||||
0 -> {
|
0 -> {
|
||||||
this.label = 1
|
this.label = 1
|
||||||
$result = suspendMe(this)
|
$result = suspendMe(this)
|
||||||
@@ -491,7 +491,7 @@ Result$Failure(Throwable)`, which we cannot just pass to `plus`, at least, witho
|
|||||||
runtime. Thus, we check the `$result` variable and throw the exception if the variable holds it.
|
runtime. Thus, we check the `$result` variable and throw the exception if the variable holds it.
|
||||||
```kotlin
|
```kotlin
|
||||||
fun invokeSuspend($result: Any?): Any? {
|
fun invokeSuspend($result: Any?): Any? {
|
||||||
when(this.label) {
|
when (this.label) {
|
||||||
0 -> {
|
0 -> {
|
||||||
this.label = 1
|
this.label = 1
|
||||||
$result = suspendMe(this)
|
$result = suspendMe(this)
|
||||||
@@ -1853,7 +1853,7 @@ ARETURN
|
|||||||
I replaced inlined `println` with a call for clarity. After turning into a state-machine, the code becomes:
|
I replaced inlined `println` with a call for clarity. After turning into a state-machine, the code becomes:
|
||||||
```kotlin
|
```kotlin
|
||||||
fun invokeSuspend($result: Any?): Any? {
|
fun invokeSuspend($result: Any?): Any? {
|
||||||
when(this.label) {
|
when (this.label) {
|
||||||
0 -> {
|
0 -> {
|
||||||
this.label = 1
|
this.label = 1
|
||||||
$result = returnsUnit(this)
|
$result = returnsUnit(this)
|
||||||
|
|||||||
Reference in New Issue
Block a user