```e: org.jetbrains.kotlin.util.FileAnalysisExcept...
# javascript
r
Copy code
e: org.jetbrains.kotlin.util.FileAnalysisException: While analysing /expanse/code/startup/thedozone2/src/jsMain/kotlin/tdz/Main.kt:22:13: java.lang.IllegalArgumentException: No type for StarProjection
        at org.jetbrains.kotlin.util.AnalysisExceptionsKt.wrapIntoFileAnalysisExceptionIfNeeded(AnalysisExceptions.kt:57)
        at org.jetbrains.kotlin.fir.FirCliExceptionHandler.handleExceptionOnFileAnalysis(Utils.kt:249)
        at org.jetbrains.kotlin.fir.resolve.transformers.body.resolve.FirDeclarationsResolveTransformer.transformFile(FirDeclarationsResolveTransformer.kt:1667)
        at org.jetbrains.kotlin.fir.resolve.transformers.body.resolve.FirAbstractBodyResolveTransformerDispatcher.transformFile(FirAbstractBodyResolveTransformerDispatcher.kt:57)
        at org.jetbrains.kotlin.fir.resolve.transformers.body.resolve.FirAbstractBodyResolveTransformerDispatcher.transformFile(FirAbstractBodyResolveTransformerDispatcher.kt:24)
        at org.jetbrains.kotlin.fir.declarations.FirFile.transform(FirFile.kt:46)
        at org.jetbrains.kotlin.fir.resolve.transformers.body.resolve.FirImplicitTypeBodyResolveTransformerAdapter.transformFile(FirImplicitBodyResolve.kt:72)
        at org.jetbrains.kotlin.fir.declarations.FirFile.transform(FirFile.kt:46)
I'm getting a compiler exception. I can report a ticket - but is there a workaround? This uses some library code which I use successfully in another project, so I'm not really sure what the difference is
t
Is there code example for
Main.kt:22:13
?
r
Yes, it's this:
Copy code
val canvas = route {
            "/{canvas}" to {
                params -> {
                    val canvas = tdzModel.getCanvas(CanvasName(params["canvas"]!!))
                    if (canvas == null) {
                        Router.navigate("/")
                    } else {
                        index(canvas)
                    }
                }
            }
        }
...which I use in another project identically without issues. It's calling library code:
Copy code
fun route(block: T.() -> Pair<String, TagConsumer<*>.(Params) -> Any>): Route {
        val (path, handler) = resource.block()
        val fullPath = (basePath + path).replace("//", "/")
        return RouteCreator.addRoute(fullPath, handler = handler)
    }
I can work around this by changing the library to use TagConsumer<HTMLElement> here, and that gets rid of the problem
In the same project, calling:
Copy code
val home = route { "/" to {
   index(tdzModel.getCanvas(rootCanvas)!!)
}
...is fine. It's specifically when attempting to use the params argument that it blows up on the TagConsumer's typing.
(And again, this works fine in another project, using my same library code, and using params...so I'm not sure how much of a bug report there is. Probably not reproducible)