mapstruct / mapstruct/mapstruct-idea
Report error for result types with wildcard extends bound
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 168
- Forks
- 41
- PR merge metrics
- No merged PRs in 30d
Description
MapStruct does not support result types with an extends bound. For example
import java.util.List;
import org.mapstruct.Mapper;
@Mapper
public interface BoundMapper {
List<? extends Number> toExtends(List<Integer> in);
}
is invalide, because of the wildcard extends bound ? extends . MapStruct reports this as
Can't generate mapping method for a wildcard extends bound result.
Currently the plugin doesn't report this as an error.
One possible QuickFix could be removing the wildcard extends bound ? extends .
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue with the BoundMapper example in IntelliJ and inspect how the plugin handles result types with wildcard extends bounds. Done means the plugin reports an error for this case, with removing the ? extends bound as a possible QuickFix; the payload names no source file or test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100