Closed knutwannheden closed 8 months ago
We currently map a typealias
to a variable declaration with an "empty" name, the alias as the type, and the aliased type as the initializer. The last bit is also where it goes wrong, because a K.FunctionType
is a TypeTree
, but not an Expression
. Instead of using a variable declaration we should probably add a new K.TypeAlias
statement type.
@traceyyoshima What are your thoughts on this?
Please note that https://github.com/openrewrite/rewrite-kotlin/commit/a880c6da45e033ee2a120941279dbfb49fe80170 now fixes the parsing side, but I think the LST is still suboptimal here.
Fixed in PSI parser
The following test:
results in the following exception: