Skip to content

Dreaming... #62

@marinasundstrom

Description

@marinasundstrom

If this analyzer ever would be a C# language feature then it would have its own syntax for the exception declarations, based on how it's done in Java:

using System;

public class Example
{
    public void RiskyMethod()
        throws InvalidOperationException, ArgumentException
    {
        // Omitted: Code that might throw
    }
}

Which would be lowered to:

using System;

public class Example
{
    [Throws(
        typeof(InvalidOperationException),
        typeof(ArgumentException))]
    public void RiskyMethod()
    {
        // Omitted: Code that might throw
    }
}

But this could be seen as going against it being optional, I think. Since you would be forced to use it if its part of the language and ecosystem.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions