Update lower/upper type inference fixing to match the latest C# standard. Fixes #15505