paperparcel icon indicating copy to clipboard operation
paperparcel copied to clipboard

CREATOR of an improper type is not reported as an error

Open sevar83 opened this issue 7 years ago • 0 comments

Hi, I've just found my own bug in this code causing an IllegalArgumentException:

@PaperParcel
data class MultiSearchState(
        val searchQuery: String? = null,
        val activeSearchType: SearchType = SearchType.MOVIES
) : ViewState, PaperParcelable {

    companion object {
        @JvmField val CREATOR = PaperParcelSearchState_SearchStarted.CREATOR
    }
}

The problem was the CREATOR val referring to another's class (SearchState.SearchStarted not MultiSearchState) creator. That's totally my mistake but it might be a good idea to show some error or warning. It's probably an often mistake after copy/paste. Anyway, thanks for the great library! It's the best.

sevar83 avatar Sep 28 '17 07:09 sevar83