Code cleanup: replace chained null-checks with safe-calls
This commit is contained in:
committed by
Mikhail Glukhikh
parent
732d1129ab
commit
7fb78a0372
@@ -590,7 +590,7 @@ class ExpectedInfos(
|
||||
if (expressionWithType != forExpression.loopRange) return null
|
||||
|
||||
val loopVar = forExpression.loopParameter
|
||||
val loopVarType = if (loopVar != null && loopVar.typeReference != null)
|
||||
val loopVarType = if (loopVar?.typeReference != null)
|
||||
(bindingContext[BindingContext.DECLARATION_TO_DESCRIPTOR, loopVar] as VariableDescriptor).type.takeUnless { it.isError }
|
||||
else
|
||||
null
|
||||
|
||||
Reference in New Issue
Block a user