Skip to content
This repository has been archived by the owner on Jun 1, 2024. It is now read-only.

[Annotation Processor] - Currently is possible to register more than one TypeAdapter for the same type. #1702

Closed
paulomeurerzup opened this issue Jul 19, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@paulomeurerzup
Copy link
Contributor

paulomeurerzup commented Jul 19, 2021

Please provide all the information requested. Issues that do not follow this format are likely to stall.

Description

Currently is possible to register more than one TypeAdapter for the same type. This can lead to unwanted behavior.

Steps To Reproduce

Provide a detailed list of steps that reproduce the issue.

  1. Register two or more TypeAdapter for the same type.
  2. Build project.

Expected Results

Annotation processor should break the build with compilation error. It should show an error message informing what are the TypeAdapters that are registered for the same type.

Code example, screenshot, or link to a repository:

@RegisterBeagleAdapter
class ModuleTypeAdapter : BeagleTypeAdapter {
override fun fromJson(json: String): Int {}
override fun toJson(type: Int): String {}
}

@RegisterBeagleAdapter
class AppTypeAdapter : BeagleTypeAdapter {
override fun fromJson(json: String): Int {}
override fun toJson(type: Int): String {}
}

@paulomeurerzup paulomeurerzup added the bug Something isn't working label Jul 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants