Open felixvf opened 8 years ago
I'm not quite sure, as my stream a bit offset from master, but this fix possible brakes some cases with generics inference. Non trivial real life example below: infering/xx_type_fixture.java
package infering;
import java.util.List;
import java.util.concurrent.CompletableFuture;
public class xx_type_fixture {
public CompletableFuture<List<Runnable>> load(List filter, int flags){
return null;
}
}
infering/xx_type_invoker_test.mirah
package infering
import java.util.function.BiConsumer
import java.util.Map
import java.util.List
class xx_type_invoker_test
def initialize(filters:List, flags:int)
@filters = filters
@flags = flags
@loader = xx_type_fixture.new
@future = nil
end
def run():void
@future = @loader.load(@filters, @flags)
end
def handle(block:BiConsumer):xx_type_invoker_test
@future.whenComplete(block)
self
end
def join():void
@future.join
end
end
With 417 fix it rise NPE in @future.whenComplete(block) while infering
Consider this Java code
and consider this Mirah code
Then it is expected that his code should compiles and prints "baz\n".
However, what is actually observed is this compiler error: