blackdrag commented on PR #3366:
URL: https://github.com/apache/groovy/pull/3366#issuecomment-7317225407
```
class Test{}
// write0
Map hints = [x: new Test()]
// read0
Test initial = hints.x
// write1
hints.single = true
// read1
Test value = hints.x
// read2
boolean bvalue = hints.sgingle
```
The proposal is to write the Boolean to the map, as it seems to be in Groovy
6.0.0, which 6.0.1 changed. The question though what will happen to the read.
If we treat hints as a Map<Object,Object>, which is what this PR does for the
write, then read1 and read2 must fail, because of the missing value type. but
why should it then work for read0 even?
For me it makes sense for hints to have the flow type <String,Integer>
initially, which means read0 works and write1 fails. I think writing a value to
the map should not change its flow type really. write0 is ok because it sets
the value for the variable.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]