Add assertion for variable as function call with explicit type parameters.

This commit is contained in:
Stanislav Erokhin
2016-07-25 14:14:20 +03:00
parent b56e84d47f
commit f3be1b8f1f
6 changed files with 5 additions and 17 deletions
@@ -1,5 +1,5 @@
/*
* Copyright 2010-2015 JetBrains s.r.o.
* Copyright 2010-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -28,7 +28,7 @@ import org.jetbrains.kotlin.util.OperatorNameConventions
class ReplaceInvokeIntention : SelfTargetingRangeIntention<KtDotQualifiedExpression>(KtDotQualifiedExpression::class.java, "Replace 'invoke' with direct call"), HighPriorityAction {
override fun applicabilityRange(element: KtDotQualifiedExpression): TextRange? {
if (element.calleeName != OperatorNameConventions.INVOKE.asString()) return null
if (element.calleeName != OperatorNameConventions.INVOKE.asString() || element.callExpression?.typeArgumentList != null) return null
return element.callExpression!!.calleeExpression!!.textRange
}