Skip to content

Commit

Permalink
fix(kotlin): remove unnecessary non-null assertion from buildTypeAnno…
Browse files Browse the repository at this point in the history
…tation call

Removed the unnecessary non-null assertion operator '!!' from the buildTypeAnnotation function calls within the OptionalParameter and RequiredParameter contexts. This ensures cleaner code by relying on the nullability handling already in place.
  • Loading branch information
phodal committed Jul 13, 2024
1 parent 1b791f9 commit f0689ef
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ open class TypeScriptAstListener : TypeScriptParserBaseListener() {
private fun buildOptionalParameter(paramCtx: TypeScriptParser.OptionalParameterContext): CodeProperty {
var paramType = ""
if (paramCtx.typeAnnotation() != null) {
paramType = buildTypeAnnotation(paramCtx.typeAnnotation())!!
paramType = buildTypeAnnotation(paramCtx.typeAnnotation())
}

return CodeProperty(
Expand All @@ -122,7 +122,7 @@ open class TypeScriptAstListener : TypeScriptParserBaseListener() {
private fun buildRequireParameter(paramCtx: TypeScriptParser.RequiredParameterContext): CodeProperty {
var paramType = ""
if (paramCtx.typeAnnotation() != null) {
paramType = buildTypeAnnotation(paramCtx.typeAnnotation())!!
paramType = buildTypeAnnotation(paramCtx.typeAnnotation())
}

return CodeProperty(
Expand Down

0 comments on commit f0689ef

Please sign in to comment.