Skip to content

Commit

Permalink
Fix warning in generated kotlin files (PolymerLabs#4288)
Browse files Browse the repository at this point in the history
```
warning: unnecessary safe call on a non-null receiver of type String
    value?.let { encoder.encode("value:T", it) }
```
  • Loading branch information
csilvestrini authored Dec 16, 2019
1 parent 4c07f92 commit 97e382e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/tools/schema2kotlin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class KotlinGenerator implements ClassGenerator {
` this.${fixed} = decoder.${decodeFn}`,
`}`);

this.encode.push(`${fixed}?.let { encoder.encode("${field}:${typeChar}", it) }`);
this.encode.push(`${fixed}.let { encoder.encode("${field}:${typeChar}", it) }`);
}

addReference(field: string, refName: string) {
Expand Down

0 comments on commit 97e382e

Please sign in to comment.