Skip to content

Change from as operator to direct cast or the opposite #65

@giggio

Description

@giggio

This:

var nullLiteral = returnElse.Expression as LiteralExpressionSyntax;

Becomes:

var nullLiteral = (LiteralExpressionSyntax)returnElse.Expression;

Or the opposite, turn a direct cast into an expression with the as operator.

Severity is Hidden.
Diagnostic id is CC0028.
Category: Refactoring

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions