question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Broken behaviour when using unimplemented inheritance

See original GitHub issue

So using a dummy maven application generated from https://start.spring.io/ and the below files added:

IThing.kt

interface IThing {
    fun behaviour
}

Thing.kt

class Thing : IThing

trying to invoke a code action in emacs throws the exception below:

async2    Internal error: org.javacs.kt.util.KotlinLSException: Error while analyzing: class Thing : IThing
java.util.concurrent.CompletionException: org.javacs.kt.util.KotlinLSException: Error while analyzing: class Thing : IThing
	at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:314)
	at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:319)
	at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1702)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: org.javacs.kt.util.KotlinLSException: Error while analyzing: class Thing : IThing
	at org.javacs.kt.compiler.Compiler.compileKtExpression(Compiler.kt:544)
	at org.javacs.kt.CompiledFile.bindingContextOf(CompiledFile.kt:45)
	at org.javacs.kt.CompiledFile.referenceAtPoint(CompiledFile.kt:68)
	at org.javacs.kt.hover.HoversKt.hoverAt(Hovers.kt:25)
	at org.javacs.kt.KotlinTextDocumentService$hover$1.invoke(KotlinTextDocumentService.kt:102)
	at org.javacs.kt.KotlinTextDocumentService$hover$1.invoke(KotlinTextDocumentService.kt:97)
	at org.javacs.kt.util.AsyncExecutor.compute$lambda-2(AsyncExecutor.kt:19)
	at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1700)
	... 3 more
Caused by: org.jetbrains.kotlin.util.KotlinFrontEndException: Exception while analyzing expression at (1,3) in /dummy.virtual.kt

Attachments:
expression.kt
class Thing : IThing
	at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorDispatcher.logOrThrowException(ExpressionTypingVisitorDispatcher.java:253)
	at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorDispatcher.lambda$getTypeInfo$0(ExpressionTypingVisitorDispatcher.java:224)
	at org.jetbrains.kotlin.util.PerformanceCounter.time(PerformanceCounter.kt:101)
	at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorDispatcher.getTypeInfo(ExpressionTypingVisitorDispatcher.java:164)
	at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorDispatcher.getTypeInfo(ExpressionTypingVisitorDispatcher.java:147)
	at org.jetbrains.kotlin.types.expressions.ExpressionTypingServices.getTypeInfo(ExpressionTypingServices.java:120)
	at org.jetbrains.kotlin.types.expressions.ExpressionTypingServices.getTypeInfo(ExpressionTypingServices.java:95)
	at org.javacs.kt.compiler.Compiler.compileKtExpression(Compiler.kt:533)
	... 10 more
Caused by: java.lang.UnsupportedOperationException: Should not be called
	at org.jetbrains.kotlin.resolve.lazy.NoTopLevelDescriptorProvider.shouldNotBeCalled(TopLevelDescriptorProvider.kt:36)
	at org.jetbrains.kotlin.resolve.lazy.NoTopLevelDescriptorProvider.getPackageFragment(TopLevelDescriptorProvider.kt:39)
	at org.jetbrains.kotlin.resolve.DeclarationResolver.getTopLevelDescriptorsByFqName(DeclarationResolver.kt:107)
	at org.jetbrains.kotlin.resolve.DeclarationResolver.checkRedeclarationsInPackages(DeclarationResolver.kt:86)
	at org.jetbrains.kotlin.resolve.LazyTopDownAnalyzer.analyzeDeclarations(LazyTopDownAnalyzer.kt:216)
	at org.jetbrains.kotlin.types.expressions.LocalClassifierAnalyzer.processClassOrObject(LocalClassifierAnalyzer.kt:120)
	at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorForStatements.visitClass(ExpressionTypingVisitorForStatements.java:167)
	at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorForStatements.visitClass(ExpressionTypingVisitorForStatements.java:68)
	at org.jetbrains.kotlin.psi.KtClass.accept(KtClass.kt:20)
	at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorDispatcher.lambda$getTypeInfo$0(ExpressionTypingVisitorDispatcher.java:175)
	... 16 more
..orker-19Excluding symbol com.android.tools.build.bundletool.validation.AutoValue_TextureCompressionFormatParityValidator_SupportedTextureCompressionFormats from index since its name is too long

Java version:

openjdk 11.0.11 2021-04-20 LTS
OpenJDK Runtime Environment Zulu11.48+21-CA (build 11.0.11+9-LTS)
OpenJDK 64-Bit Server VM Zulu11.48+21-CA (build 11.0.11+9-LTS, mixed mode)

Environment: image Emacs 28.1 (built from nix)

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
elkencommented, Aug 30, 2022

Have been super busy and don’t use kotlin anymore now 😅

I can be around to help test stuff!

1reaction
elkencommented, Jun 28, 2022

Did you wait for it to finish?

No idea how long that is meant to take, but yeah this has been a project left in emacs for days 😛

Also, there aren’t that many code actions

I know there are at least a few, but no matter what I do (outside of the “perfect” project), even though the server complains about things, everything always says “no actions available”

As for the rest, I’ll try and find time to look into it 😄

Read more comments on GitHub >

github_iconTop Results From Across the Web

Bug? "use of unimplemented initial… | Apple Developer Forums
Hi,. I tried to create a subclass of UIStackView, but I get a strange error related to `init`. My views are created in...
Read more >
Inheritance, composition, delegation, and traits - Kt. Academy
There are more problems with inheritance. The big one is that inheritance breaks encapsulation. Take a look at the following class:
Read more >
Proper Inheritance and Substitutability, C++ FAQ - Standard C++
Here's why: Bad inheritances always have a base class with an extra capability (often an extra member function or two; sometimes an extra...
Read more >
Add unimplemented methods and missing classpath entry
An error was generated indicating the the class must implement the inherited abstract method from IConfigurationWizard. I tried to use the QuickFix for...
Read more >
c# - When some methods will not be used/not implemented ...
In general, the answer to the question of whether or not to use inheritance or an interface can be answered by thinking about...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found