Status Update
Comments
si...@google.com <si...@google.com> #2
si...@google.com <si...@google.com>
ap...@google.com <ap...@google.com> #3
an...@google.com <an...@google.com> #4
si...@google.com <si...@google.com> #7
an...@google.com <an...@google.com> #8
an...@google.com <an...@google.com> #10
si...@google.com <si...@google.com> #11
given that we don't really support CharSequence in Compose. do we want to allow saving CharSequence?
If I understand you correctly, no, we don't need to allow saving CharSequence as long as we don't support it.
Maybe we should restrict it to Strings instead? what I mean is if user passes String - everything works, if user passes some CharSequence which is not String - throw an exception which asks to provide a custom Saver object. so the exact issue with AnnotatedString would be discovered earlier
"throw an exception which asks to provide a custom Saver object" sounds good to me. if the Saver does not know how to serialize a class then it is legit to throw an exception asking for help.
I do not know where we want to pay that cost (rely on the platform to do it, or handle it in common so that we have a guaranteed unified behavior.)
si...@google.com <si...@google.com> #12
- The immediate exception is fixed.
- Serializing AnnotatedString and other classes has to be done
- Multistyle text editing already is not supported, the change that caused the exception was to provide an API so that we wont change it later.
- Therefore closing this ticket and creating another ticket for AnnotatedString serialization.
Description
"Getting ClassCastException for String to AnnotatedString when passing in String to TextFieldValue in Compose snapshot 7094152"
Possibly caused by this CL
Exception is