Make project compilable after PurelyImplements annotation introduction
This commit is contained in:
+2
-2
@@ -145,8 +145,8 @@ public class FixStackAnalyzer(
|
||||
|
||||
private fun FixStackFrame.executeRestoreStackInTryCatch(insn: AbstractInsnNode) {
|
||||
val saveNode = context.saveStackMarkerForRestoreMarker[insn]
|
||||
val savedValues = savedStacks.getOrElse(saveNode) {
|
||||
throw AssertionError("${indexOf(insn)}: Restore stack is unavailable for ${indexOf(saveNode!!)}")
|
||||
val savedValues = savedStacks.getOrElse(saveNode!!) {
|
||||
throw AssertionError("${indexOf(insn)}: Restore stack is unavailable for ${indexOf(saveNode)}")
|
||||
}
|
||||
pushAll(savedValues)
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ public open class JetClass : JetClassOrObject {
|
||||
val parts = ArrayList<String>()
|
||||
var current: JetClassOrObject? = this
|
||||
while (current != null) {
|
||||
parts.add(current.getName())
|
||||
parts.add(current.getName()!!)
|
||||
current = PsiTreeUtil.getParentOfType<JetClassOrObject>(current, javaClass<JetClassOrObject>())
|
||||
}
|
||||
val file = getContainingFile()
|
||||
|
||||
+1
-1
@@ -52,7 +52,7 @@ fun createSynthesizedInvokes(functions: Collection<FunctionDescriptor>): Collect
|
||||
fakeOverride
|
||||
}
|
||||
|
||||
result.add(synthesized.substitute(TypeSubstitutor.create(invoke.getDispatchReceiverParameter()!!.getType())))
|
||||
result.add(synthesized.substitute(TypeSubstitutor.create(invoke.getDispatchReceiverParameter()!!.getType()))!!)
|
||||
}
|
||||
|
||||
return result
|
||||
|
||||
@@ -89,10 +89,10 @@ public abstract class AbstractDescriptorRendererTest : KotlinTestWithEnvironment
|
||||
val parent = accessor.getParent() as JetProperty
|
||||
val propertyDescriptor = getDescriptor(parent, resolveSession) as PropertyDescriptor
|
||||
if (accessor.isGetter()) {
|
||||
descriptors.add(propertyDescriptor.getGetter())
|
||||
descriptors.add(propertyDescriptor.getGetter()!!)
|
||||
}
|
||||
else {
|
||||
descriptors.add(propertyDescriptor.getSetter())
|
||||
descriptors.add(propertyDescriptor.getSetter()!!)
|
||||
}
|
||||
accessor.acceptChildren(this)
|
||||
}
|
||||
@@ -108,7 +108,7 @@ public abstract class AbstractDescriptorRendererTest : KotlinTestWithEnvironment
|
||||
// if class has primary constructor then we visit it later, otherwise add it artificially
|
||||
if (element !is JetClassOrObject || !element.hasExplicitPrimaryConstructor()) {
|
||||
if (descriptor.getUnsubstitutedPrimaryConstructor() != null) {
|
||||
descriptors.add(descriptor.getUnsubstitutedPrimaryConstructor())
|
||||
descriptors.add(descriptor.getUnsubstitutedPrimaryConstructor()!!)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -46,7 +46,7 @@ abstract public class AbstractFunctionDescriptorInExpressionRendererTest : Kotli
|
||||
}
|
||||
override fun visitFunctionLiteralExpression(expression: JetFunctionLiteralExpression) {
|
||||
expression.acceptChildren(this)
|
||||
descriptors.add(bindingContext.get(BindingContext.FUNCTION, expression.getFunctionLiteral()))
|
||||
descriptors.add(bindingContext.get(BindingContext.FUNCTION, expression.getFunctionLiteral())!!)
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ public class SubstitutingScope(private val workerScope: JetScope, private val su
|
||||
if (substitutor.isEmpty()) return descriptor
|
||||
|
||||
if (substitutedDescriptors == null) {
|
||||
substitutedDescriptors = HashMap<DeclarationDescriptor, DeclarationDescriptor>()
|
||||
substitutedDescriptors = HashMap<DeclarationDescriptor, DeclarationDescriptor?>()
|
||||
}
|
||||
|
||||
val substituted = substitutedDescriptors!!.getOrPut(descriptor, { descriptor.substitute(substitutor) })
|
||||
|
||||
+1
-1
@@ -117,7 +117,7 @@ class ParameterNameAndTypeCompletion(
|
||||
if (parameterType.isVisible(visibilityFilter)) {
|
||||
val lookupElement = MyLookupElement.create("", name, ArbitraryType(parameterType), lookupElementFactory)
|
||||
val count = lookupElementToCount[lookupElement] ?: 0
|
||||
lookupElementToCount[lookupElement] = count + 1
|
||||
lookupElementToCount[lookupElement!!] = count + 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -211,7 +211,7 @@ private fun lookupElementsForNullable(factory: () -> LookupElement?): Collection
|
||||
}
|
||||
lookupElement = lookupElement!!.suppressAutoInsertion()
|
||||
lookupElement = lookupElement!!.assignSmartCompletionPriority(SmartCompletionItemPriority.NULLABLE)
|
||||
result.add(lookupElement)
|
||||
result.add(lookupElement!!)
|
||||
}
|
||||
|
||||
lookupElement = factory()
|
||||
@@ -227,7 +227,7 @@ private fun lookupElementsForNullable(factory: () -> LookupElement?): Collection
|
||||
}
|
||||
lookupElement = lookupElement!!.suppressAutoInsertion()
|
||||
lookupElement = lookupElement!!.assignSmartCompletionPriority(SmartCompletionItemPriority.NULLABLE)
|
||||
result.add(lookupElement)
|
||||
result.add(lookupElement!!)
|
||||
}
|
||||
|
||||
return result
|
||||
|
||||
+1
-1
@@ -212,7 +212,7 @@ object KotlinOutputParserHelper {
|
||||
else
|
||||
Class.forName("$packagePrefix.GradleMessage\$Kind")
|
||||
|
||||
val messageKindConstants = messageKindClass.getEnumConstants()
|
||||
val messageKindConstants = messageKindClass.getEnumConstants() as Array<Any>
|
||||
for (kind in messageKindConstants) {
|
||||
when(kind.toString()) {
|
||||
"ERROR" -> severityObjectMap.put("e", kind)
|
||||
|
||||
@@ -299,7 +299,7 @@ class KotlinEvaluator(val codeFragment: JetCodeFragment,
|
||||
override fun visitProperty(property: JetProperty) {
|
||||
val value = property.getUserData(KotlinCodeFragmentFactory.LABEL_VARIABLE_VALUE_KEY)
|
||||
if (value != null) {
|
||||
valuesForLabels.put(property.getName(), value.asValue())
|
||||
valuesForLabels.put(property.getName()!!, value.asValue())
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -85,7 +85,7 @@ public class ConvertFunctionToPropertyIntention : JetSelfTargetingIntention<JetN
|
||||
|
||||
val property = originalFunction.replace(psiFactory.createProperty(function.getText())) as JetProperty
|
||||
if (needsExplicitType) {
|
||||
elementsToShorten.add(property.getTypeReference())
|
||||
elementsToShorten.add(property.getTypeReference()!!)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -54,12 +54,12 @@ public class AddLoopLabelFix(loop: JetLoopExpression, val jumpExpression: JetEle
|
||||
element.acceptChildren(object : JetTreeVisitorVoid() {
|
||||
override fun visitLabeledExpression(expression: JetLabeledExpression) {
|
||||
super.visitLabeledExpression(expression)
|
||||
usedLabels.add(expression.getLabelName())
|
||||
usedLabels.add(expression.getLabelName()!!)
|
||||
}
|
||||
})
|
||||
element.parents.forEach {
|
||||
if (it is JetLabeledExpression) {
|
||||
usedLabels.add(it.getLabelName())
|
||||
usedLabels.add(it.getLabelName()!!)
|
||||
}
|
||||
}
|
||||
return usedLabels
|
||||
|
||||
@@ -173,7 +173,7 @@ public object SuperClassNotInitialized : JetIntentionActionsFactory() {
|
||||
|
||||
for (parameter in parametersToAdd) {
|
||||
val newParameter = parameterList.addParameter(parameter)
|
||||
typeRefsToShorten.add(newParameter.getTypeReference())
|
||||
typeRefsToShorten.add(newParameter.getTypeReference()!!)
|
||||
}
|
||||
|
||||
val delegatorCall = factory.createDelegatorToSuperCall(element.getText() + "(" + parameterNames.joinToString(",") + ")")
|
||||
|
||||
+1
-1
@@ -724,7 +724,7 @@ class CallableBuilder(val config: CallableBuilderConfiguration) {
|
||||
}
|
||||
else {
|
||||
oldTypeArgumentList.replace(JetPsiFactory(callElement).createTypeArguments(renderedTypeArgs.joinToString(", ", "<", ">")))
|
||||
elementsToShorten.add(callElement.getTypeArgumentList())
|
||||
elementsToShorten.add(callElement.getTypeArgumentList()!!)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
@@ -294,6 +294,7 @@ public abstract class AbstractKotlinEvaluateExpressionTest : KotlinDebuggerTestB
|
||||
assert(localVariable != null) { "Couldn't find localVariable for label: name = $localVariableName" }
|
||||
val localVariableValue = context.getFrameProxy()!!.getValue(localVariable) as? ObjectReference
|
||||
assert(localVariableValue != null) { "Local variable $localVariableName should be an ObjectReference" }
|
||||
localVariableValue!!
|
||||
markupMap.put(localVariableValue, ValueMarkup(labelName, null, labelName))
|
||||
}
|
||||
|
||||
|
||||
@@ -68,10 +68,10 @@ public object IdeaReferenceSearcher: ReferenceSearcher {
|
||||
override fun findUsagesForExternalCodeProcessing(element: PsiElement, searchJava: Boolean, searchKotlin: Boolean): Collection<PsiReference> {
|
||||
val fileTypes = ArrayList<FileType>()
|
||||
if (searchJava) {
|
||||
fileTypes.add(JavaLanguage.INSTANCE.getAssociatedFileType())
|
||||
fileTypes.add(JavaLanguage.INSTANCE.getAssociatedFileType()!!)
|
||||
}
|
||||
if (searchKotlin) {
|
||||
fileTypes.add(JetLanguage.INSTANCE.getAssociatedFileType())
|
||||
fileTypes.add(JetLanguage.INSTANCE.getAssociatedFileType()!!)
|
||||
}
|
||||
val searchScope = GlobalSearchScope.getScopeRestrictedByFileTypes(GlobalSearchScope.projectScope(element.getProject()), *fileTypes.toTypedArray())
|
||||
return ReferencesSearch.search(element, searchScope).findAll()
|
||||
|
||||
@@ -92,7 +92,7 @@ public class FunctionReader(private val context: TranslationContext) {
|
||||
public fun contains(descriptor: CallableDescriptor): Boolean {
|
||||
val moduleName = getExternalModuleName(descriptor)
|
||||
val currentModuleName = context.getConfig().getModuleId()
|
||||
return currentModuleName != moduleName && moduleName in moduleJsDefinition
|
||||
return currentModuleName != moduleName && moduleName != null && moduleName in moduleJsDefinition
|
||||
}
|
||||
|
||||
public fun get(descriptor: CallableDescriptor): JsFunction = functionCache.get(descriptor)
|
||||
|
||||
Reference in New Issue
Block a user