This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var parameter = parameterInstance.Element; | |
if (parameter.Kind != ParameterKind.VALUE | |
&& parameter.Kind != ParameterKind.REFERENCE) return; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (arguments[currentIndex].MatchingParameter?.Element.IndexOf() is {} index && index >= 0) | |
// vs. | |
if (arguments[currentIndex].MatchingParameter?.Element.IndexOf() is >= 0 and var index) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
case IPredefinedTypeUsage predefinedTypeUsage: | |
return predefinedTypeUsage.Parent is IEnumBase | |
? null | |
: InspectPredefinedTypeUsage(predefinedTypeUsage, predefinedTypeUsage.ScalarPredefinedTypeName, boundSettingsStore); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public override AbstractValueWithInfo Divide(AbstractValue divisor) | |
{ | |
switch (divisor) | |
{ | |
case Scalar otherScalar when (otherScalar.Value == 0): | |
return AbstractValueWithInfo.DivisionByZero; | |
case Scalar otherScalar when (otherScalar.Value == 1): | |
return new AbstractValueWithInfo(this, ErrorType.DivisionByOne); | |
case Scalar otherScalar: | |
var result = Divide(myInterval, otherScalar.Value); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var argumentType = typeofExpression.ArgumentType; | |
if (!(argumentType is IDeclaredType declaredType) | |
|| declaredType.IsVoid() | |
|| declaredType is IDynamicType) return null; | |
var typeElement = declaredType.GetTypeElement(); | |
if (typeElement is ITypeParameter) return null; | |
return typeElement?.TypeParameters.Count == 0 ? typeElement : null; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var operand = dagOwnerElement.SourceElement is IIsExpression sourceIsExpression ? sourceIsExpression.Operand | |
: dagOwnerElement.SourceElement is ISwitchStatement sourceSwitchStatement ? sourceSwitchStatement.GoverningExpression | |
: dagOwnerElement.SourceElement is ISwitchExpression sourceSwitchExpression ? sourceSwitchExpression.GoverningExpression | |
: null; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var str = obj as string; | |
if (str != null) { | |
WriteLine(str.Length); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var localFunctionDeclaration = declarationStatement.LocalFunctionDeclaration; | |
if (localFunctionDeclaration != null) | |
consumer.Add(localFunctionDeclaration.DeclaredElement); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var indexerDeclaration = declaration as IIndexerDeclaration; | |
if (indexerDeclaration != null) | |
{ | |
var arrowClause = indexerDeclaration.ArrowClause; | |
if (arrowClause != null) | |
{ | |
var property = indexerDeclaration.DeclaredElement; | |
if (property != null) | |
{ | |
... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (referenceExpression.QualifierType() is IDeclaredType declaredType) | |
{ | |
if (declaredType.GetTypeElement() is IStruct @struct && @struct.IsByRefLike) | |
{ | |
consumer.AddHighlighting(new RefStructMethodGroupsError(referenceExpression)); | |
} | |
} |