> I have a very similiar reproducer with Mapstruct Version 1.6.3: > > ```java > import java.time.LocalDate; > import org.mapstruct.Mapper; > import org.mapstruct.Mapping; > import org.mapstruct.ReportingPolicy; > > @Mapper(unmappedTargetPolicy = ReportingPolicy.ERROR) > public interface RangeMapper { > > @Mapping(target = "validFrom", source = "rangeContainer.a") > @Mapping(target = "validTo", source = "rangeContainer.b") > RangeRecord toRange(RangeContainer rangeContainer); > > record RangeRecord(LocalDate validFrom, LocalDate validTo) { > > public RangeRecord restrictTo(RangeRecord other) { > return null; > } > } > > class RangeContainer { > private LocalDate a; > private LocalDate b; > > public LocalDate getA() { > return a; > } > > public void setA(LocalDate a) { > this.a = a; > } > > public LocalDate getB() { > return b; > } > > public void setB(LocalDate b) { > this.b = b; > } > } > > } > ``` > > On compile I get the error `Unmapped target property: "restrictTo".`. > > _Originally posted by @sbluemel in [#3146](https://github.com/mapstruct/mapstruct/issues/3146#issuecomment-2959044573)_