Problems for serializable types using external typealias definitions.
See original GitHub issueDescribe the bug
On Kotlin version 1.3.41
and serialization 0.11.1
, syntax and error highlighting in IntelliJ stop working properly on files which contain serializable types with members of ‘typealias’ types defined in an external module. However, the build still succeeds and all my serialization tests pass.
Also, when upgrading to Kotlin version 1.3.50
and serialization 0.13.0
this problem persists, but in addition IndexOutOfBoundsException
is thrown during compilation of JavaScript targets. Therefore, I am currently not upgrading to serialization 0.13.0
just yet.
This latter specific case has been reported before (#527), but I bet these two errors are related so I created this overarching bug report.
To Reproduce
- Define a
typealias
of any@Serializable
type in one module. - Create another module depending on the first module.
- Create a
@Serializable
type in this second module containing a member of the ‘typealias’ type previously defined in the first module.
You will notice that syntax highlighting for the typealias type does not work, and in general entire syntax and error highlighting in this file becomes broken. In addition, in case you target 1.3.50
and 0.13.0
the JS build will fail with an IndexOutOfBoundsException
.
P.s.: I’m not certain this matters, but in my specific case I am creating a typealias for ‘wildcard’ types. I.e., typealias AnySomeType = SomeType<*,*>
But, SomeType
does not contain members of the type parameters; they are solely used in functions.
Expected behavior
Highlighting to work on Kotlin 1.3.41
and in addition for the build to succeed on Kotlin 1.3.50
.
Environment
- Kotlin version:
1.3.50
- Library version:
0.13.0
- Kotlin platforms: tested on multiplatform
- Gradle version:
5.6.1
- IDE version (if bug is related to the IDE): IntelliJ IDEA (Community Edition) 2019-2-2
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:6 (4 by maintainers)
Top GitHub Comments
Has anyone found a workound for this issue? This one and #527 are keeping us from upgrading from kotlin
1.3.31
to something more recent.Removing all type-aliases from our codebase is not on option though.
I can’t reproduce this anymore on Kotlin 1.3.60. Can anybody confirm this is fixed?