Refactor; use nullable types when computing the used/max stack size.