Unexpected package fragment: package kotlin.reflect of DotlinModule: dotlin
Closed this issue · 1 comments
eggnstone commented
class A
{
companion object
{
fun a()
{
}
}
}
class B
{
fun b()
{
val f = A.Companion::a
f()
}
}
Exception in thread "main" org.dotlin.compiler.backend.DotlinLoweringError: Lowering error occurred: Unexpected package fragment: package kotlin.reflect of DotlinModule: dotlin
While processing:
FILE fqName:dev.eggnstone.plugins.jetbrains.dartformat.dotlin fileName:C:/Dev/Packages/pub.dev/dart_format/lib/src/kotlin/dev/eggnstone/plugins/jetbrains/dartformat/dotlin/DotlinTools.kt
at org.dotlin.compiler.backend.ErrorsKt$runAndReportLoweringError$1.invoke(Errors.kt:100)
at org.dotlin.compiler.backend.ErrorsKt$runAndReportLoweringError$1.invoke(Errors.kt:100)
at org.dotlin.compiler.backend.ErrorsKt.runAndReport(Errors.kt:89)
at org.dotlin.compiler.backend.ErrorsKt.runAndReportLoweringError(Errors.kt:100)
at org.dotlin.compiler.backend.steps.ir2ast.lower.IrFileLowering$DefaultImpls.lower(IrLowering.kt:97)
at org.dotlin.compiler.backend.steps.ir2ast.lower.lowerings.DartImportsLowering.lower(DartImportsLowering.kt:62)
at org.dotlin.compiler.backend.steps.ir2ast.lower.LowerKt.lower(Lower.kt:124)
at org.dotlin.compiler.backend.steps.ir2ast.lower.LowerKt.lower(Lower.kt:103)
at org.dotlin.compiler.backend.steps.ir2ast.IrToDartAstKt.irToDartAst(IrToDartAst.kt:39)
at org.dotlin.compiler.KotlinToDartCompiler.generateDartCode(KotlinToDartCompiler.kt:147)
at org.dotlin.compiler.KotlinToDartCompiler.compile(KotlinToDartCompiler.kt:77)
at org.dotlin.compiler.KotlinToDartCompiler.compile$default(KotlinToDartCompiler.kt:57)
at org.dotlin.compiler.KotlinToDartCompiler.compile(KotlinToDartCompiler.kt:52)
at org.dotlin.compiler.cli.command.Compile.run(Compile.kt:37)
at com.github.ajalt.clikt.parsers.Parser.parse(Parser.kt:198)
at com.github.ajalt.clikt.parsers.Parser.parse(Parser.kt:18)
at com.github.ajalt.clikt.core.CliktCommand.parse(CliktCommand.kt:400)
at com.github.ajalt.clikt.core.CliktCommand.parse$default(CliktCommand.kt:397)
at com.github.ajalt.clikt.core.CliktCommand.main(CliktCommand.kt:415)
at com.github.ajalt.clikt.core.CliktCommand.main(CliktCommand.kt:440)
at org.dotlin.compiler.Dotlin.main(Main.kt:26)
Caused by: java.lang.UnsupportedOperationException: Unexpected package fragment: package kotlin.reflect of DotlinModule: dotlin
at org.dotlin.compiler.backend.descriptors.DartDescriptorUtilsKt.getDartPackageFragment(DartDescriptorUtils.kt:39)
at org.dotlin.compiler.backend.DartPathGenerator.getDartPath(DartPathGenerator.kt:109)
at org.dotlin.compiler.backend.DartPathGenerator.getDartPath(DartPathGenerator.kt:129)
at org.dotlin.compiler.backend.steps.ir2ast.lower.lowerings.DartImportsLowering.maybeAddDartImportsFor(DartImportsLowering.kt:257)
at org.dotlin.compiler.backend.steps.ir2ast.lower.lowerings.DartImportsLowering.access$maybeAddDartImportsFor(DartImportsLowering.kt:62)
at org.dotlin.compiler.backend.steps.ir2ast.lower.lowerings.DartImportsLowering$transform$2.invoke(DartImportsLowering.kt:160)
at org.dotlin.compiler.backend.steps.ir2ast.lower.lowerings.DartImportsLowering$transform$2.invoke(DartImportsLowering.kt:156)
at org.dotlin.compiler.backend.steps.ir2ast.ir.ContextualTypeVisitor.visitType(ContextualTypeVisitor.kt:48)
at org.dotlin.compiler.backend.steps.ir2ast.ir.ContextualTypeVisitor.visitVariable(ContextualTypeVisitor.kt:72)
at org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid$DefaultImpls.visitVariable(IrElementVisitorVoid.kt:183)
at org.dotlin.compiler.backend.steps.ir2ast.ir.ContextualTypeVisitor.visitVariable(ContextualTypeVisitor.kt:40)
at org.dotlin.compiler.backend.steps.ir2ast.ir.ContextualTypeVisitor.visitVariable(ContextualTypeVisitor.kt:40)
at org.jetbrains.kotlin.ir.declarations.IrVariable.accept(IrVariable.kt:37)
at org.jetbrains.kotlin.ir.expressions.IrBlockBody.acceptChildren(IrBlockBody.kt:27)
at org.jetbrains.kotlin.ir.visitors.IrVisitorsKt.acceptChildrenVoid(IrVisitors.kt:15)
at org.dotlin.compiler.backend.steps.ir2ast.ir.ContextualTypeVisitor.visitElement(ContextualTypeVisitor.kt:52)
at org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid$DefaultImpls.visitBody(IrElementVisitorVoid.kt:209)
at org.dotlin.compiler.backend.steps.ir2ast.ir.ContextualTypeVisitor.visitBody(ContextualTypeVisitor.kt:40)
at org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid$DefaultImpls.visitBlockBody(IrElementVisitorVoid.kt:218)
at org.dotlin.compiler.backend.steps.ir2ast.ir.ContextualTypeVisitor.visitBlockBody(ContextualTypeVisitor.kt:40)
at org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid$DefaultImpls.visitBlockBody(IrElementVisitorVoid.kt:216)
at org.dotlin.compiler.backend.steps.ir2ast.ir.ContextualTypeVisitor.visitBlockBody(ContextualTypeVisitor.kt:40)
at org.dotlin.compiler.backend.steps.ir2ast.ir.ContextualTypeVisitor.visitBlockBody(ContextualTypeVisitor.kt:40)
at org.jetbrains.kotlin.ir.expressions.IrBlockBody.accept(IrBlockBody.kt:24)
at org.jetbrains.kotlin.ir.declarations.IrFunction.acceptChildren(IrFunction.kt:53)
at org.jetbrains.kotlin.ir.visitors.IrVisitorsKt.acceptChildrenVoid(IrVisitors.kt:15)
at org.dotlin.compiler.backend.steps.ir2ast.ir.ContextualTypeVisitor.visitElement(ContextualTypeVisitor.kt:52)
at org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid$DefaultImpls.visitDeclaration(IrElementVisitorVoid.kt:104)
at org.dotlin.compiler.backend.steps.ir2ast.ir.ContextualTypeVisitor.visitDeclaration(ContextualTypeVisitor.kt:40)
at org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid$DefaultImpls.visitFunction(IrElementVisitorVoid.kt:129)
at org.dotlin.compiler.backend.steps.ir2ast.ir.ContextualTypeVisitor.visitFunction(ContextualTypeVisitor.kt:78)
at org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid$DefaultImpls.visitSimpleFunction(IrElementVisitorVoid.kt:175)
at org.dotlin.compiler.backend.steps.ir2ast.ir.ContextualTypeVisitor.visitSimpleFunction(ContextualTypeVisitor.kt:40)
at org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid$DefaultImpls.visitSimpleFunction(IrElementVisitorVoid.kt:173)
at org.dotlin.compiler.backend.steps.ir2ast.ir.ContextualTypeVisitor.visitSimpleFunction(ContextualTypeVisitor.kt:40)
at org.dotlin.compiler.backend.steps.ir2ast.ir.ContextualTypeVisitor.visitSimpleFunction(ContextualTypeVisitor.kt:40)
at org.jetbrains.kotlin.ir.declarations.IrSimpleFunction.accept(IrSimpleFunction.kt:36)
at org.jetbrains.kotlin.ir.declarations.IrClass.acceptChildren(IrClass.kt:68)
at org.jetbrains.kotlin.ir.visitors.IrVisitorsKt.acceptChildrenVoid(IrVisitors.kt:15)
at org.dotlin.compiler.backend.steps.ir2ast.ir.ContextualTypeVisitor.visitElement(ContextualTypeVisitor.kt:52)
at org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid$DefaultImpls.visitDeclaration(IrElementVisitorVoid.kt:104)
at org.dotlin.compiler.backend.steps.ir2ast.ir.ContextualTypeVisitor.visitDeclaration(ContextualTypeVisitor.kt:40)
at org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid$DefaultImpls.visitClass(IrElementVisitorVoid.kt:113)
at org.dotlin.compiler.backend.steps.ir2ast.ir.ContextualTypeVisitor.visitClass(ContextualTypeVisitor.kt:57)
at org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid$DefaultImpls.visitClass(IrElementVisitorVoid.kt:111)
at org.dotlin.compiler.backend.steps.ir2ast.ir.ContextualTypeVisitor.visitClass(ContextualTypeVisitor.kt:40)
at org.dotlin.compiler.backend.steps.ir2ast.ir.ContextualTypeVisitor.visitClass(ContextualTypeVisitor.kt:40)
at org.jetbrains.kotlin.ir.declarations.IrClass.accept(IrClass.kt:64)
at org.jetbrains.kotlin.ir.declarations.IrFile.acceptChildren(IrFile.kt:36)
at org.jetbrains.kotlin.ir.visitors.IrVisitorsKt.acceptChildrenVoid(IrVisitors.kt:15)
at org.dotlin.compiler.backend.steps.ir2ast.ir.ContextualTypeVisitor.visitElement(ContextualTypeVisitor.kt:52)
at org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid$DefaultImpls.visitPackageFragment(IrElementVisitorVoid.kt:190)
at org.dotlin.compiler.backend.steps.ir2ast.ir.ContextualTypeVisitor.visitPackageFragment(ContextualTypeVisitor.kt:40)
at org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid$DefaultImpls.visitFile(IrElementVisitorVoid.kt:200)
at org.dotlin.compiler.backend.steps.ir2ast.ir.ContextualTypeVisitor.visitFile(ContextualTypeVisitor.kt:40)
at org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid$DefaultImpls.visitFile(IrElementVisitorVoid.kt:198)
at org.dotlin.compiler.backend.steps.ir2ast.ir.ContextualTypeVisitor.visitFile(ContextualTypeVisitor.kt:40)
at org.dotlin.compiler.backend.steps.ir2ast.ir.ContextualTypeVisitor.visitFile(ContextualTypeVisitor.kt:40)
at org.jetbrains.kotlin.ir.declarations.IrFile.accept(IrFile.kt:30)
at org.jetbrains.kotlin.ir.visitors.IrVisitorsKt.acceptVoid(IrVisitors.kt:11)
at org.dotlin.compiler.backend.steps.ir2ast.ir.ContextualTypeVisitorKt.visitTypes(ContextualTypeVisitor.kt:37)
at org.dotlin.compiler.backend.steps.ir2ast.lower.lowerings.DartImportsLowering.transform(DartImportsLowering.kt:156)
at org.dotlin.compiler.backend.steps.ir2ast.lower.IrFileLowering$lower$1$1.invoke(IrLowering.kt:97)
at org.dotlin.compiler.backend.steps.ir2ast.lower.IrFileLowering$lower$1$1.invoke(IrLowering.kt:97)
at org.dotlin.compiler.backend.ErrorsKt.runAndReport(Errors.kt:86)
... 18 more
wilkomanger commented
Yeah this is expected because callable references aren't supported yet. It's tracked in #34 so I'll close this 👍 But I'll bump it up a bit if it's something you need