codeconsole commented on PR #3289: URL: https://github.com/apache/groovy/pull/3289#issuecomment-6812919027
Thanks. 2ceac52315 applies the same rule to a field initializer and to `this.f` / `other.f`: when the target is a parameterized `Class` and the value is not a `Class`, the target type is used. A `Class` value still goes through the generic check, so `Class<?>` to `Class<? extends CharSequence>` is still rejected in all three places, and the test now covers that. I also replaced the `Object o = Integer` lines with an `Object` parameter, because, as you pointed out, the flow typing made the local a `Class<Integer>`. Without the change the test fails on the `String` and `Type` lines and on the three new writes. `STCAssignmentTest`, `AssignmentsStaticCompileTest`, `groovy.transform.stc.*`, `org.codehaus.groovy.classgen.asm.sc.*` and `groovy.bugs.*` pass. -- 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]
