Imagine I have a @Validate rule whose subject is of type ModelMap<SomeSourceSet>. I try to use map.values().each() to iterate over all the source sets, but doing so results in an error “Attempt to read a write only view of model of type…”. So I end up using .afterEach(), which is weird because I’m not attempting to configure the source sets, only validate them.
I use map.values().each() when ModelMap<...> is a rule input and that works fine.
Sounds like not intended behaviour to me. Not sure if this is something we have already on our radar to fix. Maybe @CedricChampeau or @lptr can help out here?