java.lang.AssertionError: Only integer constants should be checked for overflow

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Solutions on the web

via YouTrack by Unknown author, 1 year ago
Only integer constants should be checked for overflow
java.lang.AssertionError: Only integer constants should be checked for overflow
at org.jetbrains.kotlin.resolve.constants.evaluate.ConstantExpressionEvaluatorVisitor.evaluateBinaryAndCheck(ConstantExpressionEvaluator.kt:505)
at org.jetbrains.kotlin.resolve.constants.evaluate.ConstantExpressionEvaluatorVisitor.evaluateCall(ConstantExpressionEvaluator.kt:448)
at org.jetbrains.kotlin.resolve.constants.evaluate.ConstantExpressionEvaluatorVisitor.visitBinaryExpression(ConstantExpressionEvaluator.kt:403)
at org.jetbrains.kotlin.resolve.constants.evaluate.ConstantExpressionEvaluatorVisitor.visitBinaryExpression(ConstantExpressionEvaluator.kt:228)
at org.jetbrains.kotlin.psi.KtBinaryExpression.accept(KtBinaryExpression.java:33)
at org.jetbrains.kotlin.resolve.constants.evaluate.ConstantExpressionEvaluatorVisitor.evaluate(ConstantExpressionEvaluator.kt:241)
at org.jetbrains.kotlin.resolve.constants.evaluate.ConstantExpressionEvaluator.evaluateExpression(ConstantExpressionEvaluator.kt:201)
at org.jetbrains.kotlin.types.expressions.BasicExpressionTypingVisitor.visitBinaryExpression(BasicExpressionTypingVisitor.java:990)
at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorDispatcher.visitBinaryExpression(ExpressionTypingVisitorDispatcher.java:404)
at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorDispatcher$ForBlock.visitBinaryExpression(ExpressionTypingVisitorDispatcher.java:68)
at org.jetbrains.kotlin.psi.KtBinaryExpression.accept(KtBinaryExpression.java:33)
at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorDispatcher$1.invoke(ExpressionTypingVisitorDispatcher.java:182)
at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorDispatcher$1.invoke(ExpressionTypingVisitorDispatcher.java:172)
at org.jetbrains.kotlin.util.PerformanceCounter.time(PerformanceCounter.kt:92)
at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorDispatcher.getTypeInfo(ExpressionTypingVisitorDispatcher.java:172)
at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorDispatcher.getTypeInfo(ExpressionTypingVisitorDispatcher.java:143)
at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorForStatements.visitBinaryExpression(ExpressionTypingVisitorForStatements.java:170)
at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorForStatements.visitBinaryExpression(ExpressionTypingVisitorForStatements.java:59)
at org.jetbrains.kotlin.psi.KtBinaryExpression.accept(KtBinaryExpression.java:33)
at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorDispatcher$1.invoke(ExpressionTypingVisitorDispatcher.java:182)
at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorDispatcher$1.invoke(ExpressionTypingVisitorDispatcher.java:172)
at org.jetbrains.kotlin.util.PerformanceCounter.time(PerformanceCounter.kt:92)
at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorDispatcher.getTypeInfo(ExpressionTypingVisitorDispatcher.java:172)
at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorDispatcher.getTypeInfo(ExpressionTypingVisitorDispatcher.java:156)
at org.jetbrains.kotlin.types.expressions.ExpressionTypingServices.getTypeOfLastExpressionInBlock(ExpressionTypingServices.java:292)
at org.jetbrains.kotlin.types.expressions.ExpressionTypingServices.getBlockReturnedTypeWithWritableScope(ExpressionTypingServices.java:243)
at org.jetbrains.kotlin.types.expressions.ExpressionTypingServices.getBlockReturnedType(ExpressionTypingServices.java:175)
at org.jetbrains.kotlin.types.expressions.ExpressionTypingServices.getBlockReturnedType(ExpressionTypingServices.java:154)
at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorForStatements.visitBlockExpression(ExpressionTypingVisitorForStatements.java:388)
at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorForStatements.visitBlockExpression(ExpressionTypingVisitorForStatements.java:59)
at org.jetbrains.kotlin.psi.KtBlockExpression.accept(KtBlockExpression.java:44)
at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorDispatcher$1.invoke(ExpressionTypingVisitorDispatcher.java:182)
at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorDispatcher$1.invoke(ExpressionTypingVisitorDispatcher.java:172)
at org.jetbrains.kotlin.util.PerformanceCounter.time(PerformanceCounter.kt:92)
at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorDispatcher.getTypeInfo(ExpressionTypingVisitorDispatcher.java:172)
at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorDispatcher.getTypeInfo(ExpressionTypingVisitorDispatcher.java:156)
at org.jetbrains.kotlin.types.expressions.ExpressionTypingServices.checkFunctionReturnType(ExpressionTypingServices.java:149)
at org.jetbrains.kotlin.types.expressions.ExpressionTypingServices.checkFunctionReturnType(ExpressionTypingServices.java:133)
at org.jetbrains.kotlin.resolve.BodyResolver.resolveFunctionBody(BodyResolver.java:831)
at org.jetbrains.kotlin.resolve.BodyResolver.resolveFunctionBody(BodyResolver.java:777)
at org.jetbrains.kotlin.idea.project.ResolveElementCache.functionAdditionalResolve(ResolveElementCache.kt:470)
at org.jetbrains.kotlin.idea.project.ResolveElementCache.performElementAdditionalResolve(ResolveElementCache.kt:277)
at org.jetbrains.kotlin.idea.project.ResolveElementCache.getElementAdditionalResolve(ResolveElementCache.kt:153)
at org.jetbrains.kotlin.idea.project.ResolveElementCache.resolveToElement(ResolveElementCache.kt:193)
at org.jetbrains.kotlin.idea.caches.resolve.ResolutionFacadeImpl.analyze(ProjectResolutionFacade.kt:109)
at org.jetbrains.kotlin.idea.caches.resolve.ResolutionUtils.analyze(resolutionApi.kt:60)
at org.jetbrains.kotlin.idea.references.AbstractKtReference.resolveToPsiElements(KtReference.kt:74)
at org.jetbrains.kotlin.idea.references.AbstractKtReference.resolve(KtReference.kt:50)
at com.intellij.codeInsight.TargetElementUtil.doGetReferenceOrReferencedElement(TargetElementUtil.java:391)
at com.intellij.codeInsight.TargetElementUtil.getReferenceOrReferencedElement(TargetElementUtil.java:368)
at com.intellij.codeInsight.TargetElementUtil.doFindTargetElement(TargetElementUtil.java:238)
at com.intellij.codeInsight.TargetElementUtil.findTargetElement(TargetElementUtil.java:210)
at com.intellij.codeInsight.daemon.impl.IdentifierHighlighterPass.doCollectInformation(IdentifierHighlighterPass.java:91)
at com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:70)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$null$0(PassExecutorService.java:434)
at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1034)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$doRun$1(PassExecutorService.java:427)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:494)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:443)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:54)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.doRun(PassExecutorService.java:426)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:402)
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)

Users with the same issue

You are the first who have seen this exception.

Write tip

Know the solutions? Share your knowledge to help other developers to debug faster.