Support default values for optional parameters in newinstance() with closures
Convert to newinstance with closure definitions