Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
-
None
Description
Consider the following (extracted from mybatis SelectDSLCompleter):
class Model { } interface Output<T> { T build() } abstract class Input<T> extends QueryDSL<Inner> implements Output<T> { class Inner implements Output<T> { @Override T build() { } } } abstract class QueryDSL<X> { abstract X where() } @FunctionalInterface interface Func extends Function<Input<Model>, Output<Model>> { } void select(Func func) { } @groovy.transform.TypeChecked void test() { select { input -> input.where() } // Cannot return value of type Inner for closure expecting Output<Model> }
"input" is inferred correctly to be of type "Input<Model>" which should lead to an "Inner" return type for "where()" that implements "Output<Model>". Some context is lost along the way and "Output<Object>" is inferred instead.