gi: support may be null
gi: support generic constructor