Code Monkey home page Code Monkey logo

Comments (5)

DavidArno avatar DavidArno commented on July 24, 2024 10

.NET 8 and C# 12 were released yesterday and so this is now an issue with production code. For now, I've had to disable the SA1010 rule for our code until this can be fixed. Please can this be fixed as quickly as possible.

from stylecopanalyzers.

MiYanni avatar MiYanni commented on July 24, 2024 5

I hit this when telling VS to make fixes for Use collection initializers (IDE0028). It will automatically create statements that trigger SA1010. For example:

List<string> foo = [];

from stylecopanalyzers.

bjornhellander avatar bjornhellander commented on July 24, 2024 3

I assume that .NET 8 and C# 12 will be released very soon now. This fix is probably trivial, but what do you think about adding a new test project, @sharwell? Should it wait until you are done with your updates to the test projects (#3675 (comment)), or can it be done now? If you would like to wait, do you have any estimate of when you will be done?

from stylecopanalyzers.

commonsensesoftware avatar commonsensesoftware commented on July 24, 2024 1

I'm unsure if all the various cases are being tracked or accounted for, but I thought I would report that SA1010 also fires during coalesce, coalesce assign, and ternary operations.

List<string>? list = default;

// fires on coalesce
List<string> otherList = list ?? [];

// fires on ternary
List<string> anotherList = list is null ? [] : list;

// fires on coalesce assigement
list ??= [];

from stylecopanalyzers.

dciborow avatar dciborow commented on July 24, 2024

Hit this in a few places.

ctors = [.. ctors.OrderByDescending(info => info.GetParameters().Length)];
object result = TypesManager.InvokeGenericStaticMethod(typeof(ServiceLocator), nameof(ResolveMock), [type]);
if (request.OtherEmails != null)
{
    emails = [.. request.OtherEmails.Split([';', ','])];
}
        public static readonly string[] AllBlastRadiusStrings = [SingleNode, SingleCustomer, SingleScaleUnitSlicePartition, SingleScaleUnit, SingleRack, SingleCluster, SingleAZ, SingleRegion, MultipleRacks, MultipleClusters, MultipleAZs, MultipleRegions, Global, Other];

from stylecopanalyzers.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.