Skip to content

Commit

Permalink
Minor fix in ImportOptimizer
Browse files Browse the repository at this point in the history
  • Loading branch information
sxhya committed Oct 18, 2024
1 parent f45b873 commit b795b67
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import com.intellij.psi.util.elementType
import com.intellij.psi.util.parentOfType
import com.intellij.psi.util.parentsOfType
import com.intellij.util.concurrency.annotations.RequiresWriteLock
import org.arend.core.definition.Definition.TypeCheckingStatus.NO_ERRORS
import org.arend.core.expr.FunCallExpression
import org.arend.ext.concrete.definition.FunctionKind
import org.arend.ext.module.ModulePath
Expand Down Expand Up @@ -420,7 +421,7 @@ private class ImportStructureCollector(

private fun addCoreGlobalInstances(element: ArendDefinition<*>) {
val tcReferable = (element.tcReferable as? TCDefReferable)?.typechecked
allDefinitionsTypechecked = allDefinitionsTypechecked && (tcReferable != null)
allDefinitionsTypechecked = allDefinitionsTypechecked && (tcReferable != null && tcReferable.status() == NO_ERRORS)
if (!allDefinitionsTypechecked) return
tcReferable!!.accept(object : SearchVisitor<Unit>() { // not-null assertion implied by '&&' above
override fun visitFunCall(expr: FunCallExpression?, params: Unit?): Boolean {
Expand Down

0 comments on commit b795b67

Please sign in to comment.