Skip to content

Commit f0689ef

Browse files
committed
fix(kotlin): remove unnecessary non-null assertion from buildTypeAnnotation 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.
1 parent 1b791f9 commit f0689ef

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

chapi-ast-typescript/src/main/kotlin/chapi/ast/typescriptast/TypeScriptAstListener.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ open class TypeScriptAstListener : TypeScriptParserBaseListener() {
110110
private fun buildOptionalParameter(paramCtx: TypeScriptParser.OptionalParameterContext): CodeProperty {
111111
var paramType = ""
112112
if (paramCtx.typeAnnotation() != null) {
113-
paramType = buildTypeAnnotation(paramCtx.typeAnnotation())!!
113+
paramType = buildTypeAnnotation(paramCtx.typeAnnotation())
114114
}
115115

116116
return CodeProperty(
@@ -122,7 +122,7 @@ open class TypeScriptAstListener : TypeScriptParserBaseListener() {
122122
private fun buildRequireParameter(paramCtx: TypeScriptParser.RequiredParameterContext): CodeProperty {
123123
var paramType = ""
124124
if (paramCtx.typeAnnotation() != null) {
125-
paramType = buildTypeAnnotation(paramCtx.typeAnnotation())!!
125+
paramType = buildTypeAnnotation(paramCtx.typeAnnotation())
126126
}
127127

128128
return CodeProperty(

0 commit comments

Comments
 (0)