Kotlin / dukat

Converter of <any kind of declarations> to Kotlin external declarations
557 stars 42 forks source link

Please, highlight the essence of the problem in the title #479

Open ilgonmic opened 2 years ago

ilgonmic commented 2 years ago

πŸ•— Version

0.5.8-rc.4

export type TranscodeEncoding = "ascii" | "utf8" | "utf16le" | "ucs2" | "latin1" | "binary";
export function transcode(source: Uint8Array, fromEnc: TranscodeEncoding, toEnc: TranscodeEncoding): Buffer;

πŸ™ Actual behavior

Multiple overloaded methods with the same signature with suppress error. Leads to compiler error

e: java.lang.IllegalStateException: Return type is not initialized
at org.jetbrains.kotlin.ir.declarations.impl.IrFunctionBase.getReturnType(IrFunctionBase.kt:57)
at org.jetbrains.kotlin.ir.util.RenderIrElementVisitor.visitSimpleFunction(RenderIrElement.kt:367)
at org.jetbrains.kotlin.ir.util.RenderIrElementVisitor.visitSimpleFunction(RenderIrElement.kt:39)
at org.jetbrains.kotlin.ir.declarations.impl.IrFunctionImpl.accept(IrFunctionImpl.kt:137)
at org.jetbrains.kotlin.ir.util.RenderIrElementKt.render(RenderIrElement.kt:37)
at org.jetbrains.kotlin.ir.symbols.impl.IrBindablePublicSymbolBase.bind(IrPublicSymbolBase.kt:49)
at org.jetbrains.kotlin.ir.declarations.impl.IrFunctionImpl.<init>(IrFunctionImpl.kt:133)
at org.jetbrains.kotlin.ir.declarations.impl.IrFunctionImpl.<init>(IrFunctionImpl.kt:92)
at org.jetbrains.kotlin.ir.declarations.impl.IrFunctionImpl.<init>(IrFunctionImpl.kt:104)
at org.jetbrains.kotlin.ir.util.OverridesKt$declareSimpleFunctionWithOverrides$1.invoke(overrides.kt:25)
at org.jetbrains.kotlin.ir.util.OverridesKt$declareSimpleFunctionWithOverrides$1.invoke(overrides.kt)
at org.jetbrains.kotlin.ir.util.SymbolTable.declareSimpleFunction(SymbolTable.kt:1561)
at org.jetbrains.kotlin.ir.util.OverridesKt.declareSimpleFunctionWithOverrides(overrides.kt:24)
at org.jetbrains.kotlin.psi2ir.generators.FunctionGenerator.declareSimpleFunctionInner(FunctionGenerator.kt:82)
at org.jetbrains.kotlin.psi2ir.generators.FunctionGenerator.access$declareSimpleFunctionInner(FunctionGenerator.kt:33)
at org.jetbrains.kotlin.psi2ir.generators.FunctionGenerator.generateFunctionDeclaration(FunctionGenerator.kt:358)
at org.jetbrains.kotlin.psi2ir.generators.DeclarationGenerator.generateMemberDeclaration(DeclarationGenerator.kt:44)
at org.jetbrains.kotlin.psi2ir.generators.ModuleGenerator.generateSingleFile(ModuleGenerator.kt:84)
at org.jetbrains.kotlin.psi2ir.generators.ModuleGenerator.generateFiles(ModuleGenerator.kt:69)
at org.jetbrains.kotlin.psi2ir.generators.ModuleGenerator.generateModuleFragmentWithoutDependencies(ModuleGenerator.kt:44)
at org.jetbrains.kotlin.psi2ir.Psi2IrTranslator.generateModuleFragment(Psi2IrTranslator.kt:83)
at org.jetbrains.kotlin.ir.backend.js.KlibKt.generateModuleFragmentWithPlugins(klib.kt:333)
at org.jetbrains.kotlin.ir.backend.js.KlibKt.generateKLib(klib.kt:166)
at org.jetbrains.kotlin.cli.js.K2JsIrCompiler.doExecute(K2JsIrCompiler.kt:189)
ilgonmic commented 2 years ago

https://youtrack.jetbrains.com/issue/KT-41240