-
Notifications
You must be signed in to change notification settings - Fork 101
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
Reduce the number of suppressions for internal access #308
Conversation
override fun serialize(encoder: Encoder, value: DayOfWeek): Unit = impl.serialize(encoder, value) | ||
} | ||
public object DayOfWeekSerializer : KSerializer<DayOfWeek> by createEnumSerializer<DayOfWeek>( | ||
"kotlinx.datetime.serializers.DayOfWeek", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that it is technically a breaking change: it provide FQ name as serial name (as we do and recommend doing in the serialization) and also replaces Month
(which is a copy-paste error I believe)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By what principle this FQ name is built? Is it the name of the serialized type?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to the documentation:
For generated serializers, serial name is equal to the corresponding class's fully-qualified name or, if overridden, SerialName. Custom serializers should provide a unique serial name that identify both the serializable class and the serializer itself, ignoring type arguments, if they are present.
We consider this one as "the default generated serializer" in fact, thus FQN of the serialized type.
I also opened Kotlin/kotlinx.serialization#2581 to make it clear
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"FQN of the serialized type" - ok, then it should be changed as there is no type with this FQN :)
Perhaps to "kotlinx.datetime.DayOfWeek"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've changed it consistently across the codebase.
It also led to a format change in tests that you can observe in a separate commit.
Please exclude InlineOnly annotation removal, there's no problems with it in K2, as I was told in KT-60866 |
426c247
to
06ed460
Compare
Done |
06ed460
to
6c5b80f
Compare
override fun serialize(encoder: Encoder, value: DayOfWeek): Unit = impl.serialize(encoder, value) | ||
} | ||
public object DayOfWeekSerializer : KSerializer<DayOfWeek> by createEnumSerializer<DayOfWeek>( | ||
"kotlinx.datetime.serializers.DayOfWeek", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By what principle this FQ name is built? Is it the name of the serialized type?
6c5b80f
to
bc78bca
Compare
@ilya-g sorry for the delay, it got lost from my radar. PTAL |
ac9c388
to
e41adc2
Compare
e41adc2
to
2574330
Compare
While backporting K2 commits, I've spotted one related to
internal
declarations.Instead of backporting it, I decided to tide it up in the face of https://youtrack.jetbrains.com/issue/KT-60866/Phase-out-usages-of-SuppressINVISIBLEREFERENCE-INVISIBLEMEMBER-in-libraries