question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Problems for serializable types using external typealias definitions.

See original GitHub issue

Describe 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

  1. Define a typealias of any @Serializable type in one module.
  2. Create another module depending on the first module.
  3. 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:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

7reactions
mdietrichsteincommented, Oct 9, 2019

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.

1reaction
sandwwraithcommented, Nov 21, 2019

I can’t reproduce this anymore on Kotlin 1.3.60. Can anybody confirm this is fixed?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Encoding, Decoding, and Serialization - Apple Developer
Serialize and deserialize instances of your types with implicit or customized encoding.
Read more >
Java Object Serialization Specification: 1 - System Architecture
The serializable fields of a class can be defined two different ways. Default serializable fields of a class are defined to be the...
Read more >
MLIR Language Reference
MLIR is designed to be used in three different forms: a human-readable textual form ... toplevel := (operation | attribute-alias-def | type-alias-def)*.
Read more >
Customization - OpenAPI Generator
User-defined Templates. ... This feature requires using the external configuration file feature ... API related types create a file per API.
Read more >
scala - NotSerializableException for `Map[String, String]` alias
The type alias has absolutely nothing to do with this. This is a runtime issue and type aliases exists only in compile time....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found