You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Which results in a compilation error (inferred type is List<String> but MutableList<String> was expected):
>Task:compileKotlin FAILED
e: ~/foo/build/generated/source/kaptKotlin/main/io/vertx/example/StudentList.kt: (34, 22):Type inference failed. Expected type mismatch: inferred type isList<String> but MutableList<String> was expected
The text was updated successfully, but these errors were encountered:
...Compile-time references to List and MutableList are both compiled to java.util.List references. Therefore, it's not possible to detect whether a list is a MutableList at runtime.
Edit: you can seemingly cast toList() as toList() as MutableList<String>, although I'm not certain the impact of this.
Given the following (contrived) data object:
The generated helper functions will incorrectly use
toList()
(IMMUTABLE) insteadtoMutableList()
:Which results in a compilation error (
inferred type is List<String> but MutableList<String> was expected
):The text was updated successfully, but these errors were encountered: