codeconsole commented on PR #3090:
URL: https://github.com/apache/groovy/pull/3090#issuecomment-7089291895

   Master is merged again in 69d967d. The only conflict was the block of 
private constants in `StaticTypeCheckingVisitor`: GROOVY-12727's 
`CALL_TARGET_TYPE` and this branch's keys are separate declarations, so both 
are kept. Master's new `RegressionTest` had GROOVY-12561 marked as not yet 
implemented. This branch fixes it, so 7867abf removes the case, which 
`FunctionalTypeArgumentTest` covers. A closure passed to a generic call whose 
type parameter GROOVY-12727 takes from the target (assignment, return, cast, 
nested argument, conditional) behaves the same on master, on this branch before 
the merge and after it.
   
   A further review of the closure classes found cases that regressed or did 
not work, now fixed:
   
   - 0939f36: a closure for a `List<Function<? super String, Integer>>` did not 
compile ("must implement R apply(T)"). The class now implements the interface 
with the type each wildcard stands for, so the verifier adds the bridge.
   - 4731d3b: a closure with a variadic parameter, a default value, or more or 
fewer parameters than the interface method no longer compiled. Such a closure 
is now stored as it is, as before.
   - cc72e80: for an interface with a default method `Closure` would replace, 
such as `getOwner()`, the closure class replaced it. Such an interface is not 
implemented now. The check compares parameter types, so `Function`'s 
`andThen(Function)` is not affected.
   - 86cbfc2: dynamic code could not call a default method of the implemented 
interface through `invokeMethod`, a method pointer or `with`. 
`ClosureMetaClass` now finds it.
   - d5cbedc: the "stored as it is" warning is no longer given for a value 
whose type implements the interface already, such as 
`Closures.FunctionClosure`, or for a lambda or method reference in a 
conditional assigned to a subscript or property, which the assignment compiles 
for the interface.
   
   76b60e2 documents these, and that a closure written as an operator operand, 
a branch of a conditional or a named constructor argument does not get its 
parameter types from the interface, as on master, so `it` needs a declared type 
there. The full suite (22,525 tests) and the lint gate pass locally.


-- 
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]

Reply via email to