enhanced type-inference (original) (raw)

Raab, Donald Donald.Raab at gs.com
Wed Jan 30 21:40:00 PST 2013


Updated to b75 tonight and tried out the enhanced inference with the gsc kata. Much Better! Will be really nice when IntelliJ includes the same level of inference now.

Here's the result with the usual complex example:

Map<Double, Collection> multimap = this.company.getCustomers() .stream() .collect(groupingBy(customer -> customer.getOrders() .stream() .explode((Stream.Downstream downstream, Order order) -> { downstream.send(order.getLineItems()); }) .map(LineItem::getValue) .reduce(0.0, (x, y) -> Math.max(x, y))));

-----Original Message----- From: lambda-libs-spec-experts-bounces at openjdk.java.net [mailto:lambda-_ _libs-spec-experts-bounces at openjdk.java.net] On Behalf Of Brian Goetz Sent: Friday, January 25, 2013 1:11 PM To: lambda-libs-spec-experts at openjdk.java.net Subject: Fwd: enhanced type-inference

More info on new type inference.

-------- Original Message -------- Subject: enhanced type-inference Date: Fri, 25 Jan 2013 17:49:07 +0000 From: Maurizio Cimadamore <maurizio.cimadamore at oracle.com> Organization: Oracle To: lambda-dev <lambda-dev at openjdk.java.net> Dear lambdackers, I've just pushed a patch that enables a more general inference support for nested generic method calls/stuck expressions. This scheme has been available for a while in lambda-repo (when using the hidden flag - XDuseGraphInference), but we have now decided it's time to flip the switch and make it the default when using JDK 8. In the past few weeks I've been hunting down as many bugs in the new inference scheme as possible, in order to provide a smooth transition from the old world to the new one. I hope the transition is indeed smooth - but, given the nature of the change, I also expect bugs to pop up here and there, so please, keep throwing the kitchen sink at javac and report your experience back to us; without your valuable feedback and dedication we would never have gotten thus far. Example of things that now work: Stream si = ... List l1 = si.into(new ArrayList<>()); //not really - too late for that ;-) List l2 = si.collect(toList()); List l3 = si.collect(toCollection(ArrayList::new)); Thanks Maurizio



More information about the lambda-libs-spec-observers mailing list