-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Kotlin data class compile-time error #53
Comments
This is a kotlin kapt issue.
|
Thanks, it's done. Now there is another error: data class:
gradle module setups:
|
Hm, is it because of the default value |
Looks like there is another problem related to kapt3 in Kotlin 1.0.6 as on 1.0.5 TikXml works okay on simple data classes.
|
Example project that represent my problem: https://github.com/Try4W/tikxml-example/ (Kotlin 1.0.4) |
Please try it with kotlin https://blog.jetbrains.com/kotlin/2017/02/kotlin-1-1-release-candidate-is-here/#more-4589 |
1.1.0-RC prints warning like:
Now error rendered and looks like that:
It seems to be TikXml's problem. Should I report it to kotlin issue tracker? (repo with demo updated) |
that seems to be the same error as originally reported. Maybe it is because
of List<? extends Paragraph.Part> as you have already suggested.
I will take a look next week.
The strange thing is, that we are using kotlin (with all various versions)
and use polymorphic lists quite often at work without seeing such an issue.
I just did a quick check in our code base and we mainly use var which are
defined in the class body and not in constructor parameters. Maybe it is
worth trying that too in your example, but as far as I remember it should
not make a difference because it is using internally the same code.
Alexandr <[email protected]> schrieb am Fr., 17. Feb. 2017, 20:28:
… 1.1.0-RC prints warning like:
w: Running the Kotlin compiler under Java 6 or 7 is unsupported and will no longer be possible in a future update.
com/sun/tools/javac/code/TypeTag fixed via using Java 8 to run gradle
Now error rendered and looks like that:
e: C:\Users\Alexandr\AndroidStudioProjects\tikxml-example\build\tmp\kapt3\stubs\main\Paragraph.java:23: error: The constructor parameter 'parts' in constructor Paragraph(java.lang.String,java.util.List<? extends Paragraph.Part>) in class Paragraph is annotated with a TikXml annotation. Therefore a getter method with minimum package visibility with the name getParts() or isParts() in case of a boolean must be provided. Unfortunately, there is no such getter method. Please provide one!
e:
e: java.util.List<? extends Paragraph.Part> parts) {
e: ^
e: C:\Users\Alexandr\AndroidStudioProjects\tikxml-example\src\main\kotlin\Paragraph.kt: (1, 1): Some error(s) occurred while processing annotations. Please see the error messages above.
It seems to be TikXml's problem. Should I report it to kotlin issue
tracker?
(repo with demo updated)
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#53 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAjnrvaS8Z4NiFx26qSQACiGIZEl_Is9ks5rdfTggaJpZM4MEPoK>
.
|
Some examples. Working:
Working:
Working:
Not working:
Not working:
|
List<@JvmSuppressWildcards Part> might be useful. |
I see such compile-time error:
Error:Gradle: The constructor parameter 'arg0' in constructor Narration(java.lang.String) in class red.kometa.quest.common.entities.Paragraph.Part.Narration is annotated with a TikXml annotation. Therefore a getter method with minimum package visibility with the name getArg0() or isArg0() in case of a boolean must be provided. Unfortunately, there is no such getter method. Please provide one!
there is my data classes:
Kotlin must generate such getters&setters.
kotlin_version = '1.0.6'
tikxml_verions = '0.8.9-SNAPSHOT'
The text was updated successfully, but these errors were encountered: