static A getWeakRef(Reference ref) { ret ref == null ? null : ref!; }