blob: f30b6ddeaf197f0249f7bd9b60f0e9b5b48de139 [file] [log] [blame]
import org.checkerframework.common.returnsreceiver.qual.*;
public class MethodRef {
@This MethodRef set(Object o) {
return this;
}
interface Setter {
@This Object consume(Object p);
}
// :: error: methodref.receiver.bound
Setter co = this::set;
void doNothing(@This MethodRef this) {}
interface Fun {
void run(@This Fun this);
}
// The error here is a false positive, due to
// https://github.com/typetools/checker-framework/issues/2931
// :: error: methodref.receiver.bound
Fun f = this::doNothing;
}