Uploaded image for project: 'Apache Avro'
  1. Apache Avro
  2. AVRO-3383 C# Coding Style Guidelines
  3. AVRO-3491

Fix IDE0020 Use pattern matching to avoid 'is' check followed by a cast

    XMLWordPrintableJSON

Details

    Description

      // csharp_style_pattern_matching_over_is_with_cast_check = true
      if (o is int i) {...}
      
      // csharp_style_pattern_matching_over_is_with_cast_check = false
      if (o is int) {var i = (int)o; ... } 

      For Reference: [Use pattern matching to avoid 'is' check followed by a cast (IDE0020 and IDE0038) - .NET | Microsoft Docs|https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0020-ide0038]

      Attachments

        Issue Links

          Activity

            People

              KSchoonover Kyle Schoonover
              KSchoonover Kyle Schoonover
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 40m
                  40m