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 pattern = Pattern; | |
| var constantPattern = pattern as IConstantPattern; | |
| if (constantPattern != null) | |
| { | |
| return IsTypeFromConstantPattern(constantPattern); | |
| } | |
| var declarationPattern = pattern as IDeclarationPattern; | |
| if (declarationPattern != 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
| public IType GetEqualityParameterType(int parameterIndex) | |
| { | |
| if (myCachedEqualityParameterTypes[parameterIndex] == null) | |
| myCachedEqualityParameterTypes[parameterIndex] = myEqualitySubstitution.Apply(myParameters[parameterIndex].Type); | |
| return myCachedEqualityParameterTypes[parameterIndex]; | |
| } |
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
| using System; | |
| // ReSharper disable UnusedParameter.Local | |
| // ReSharper disable UnusedVariable | |
| // ReSharper disable FunctionRecursiveOnAllPaths | |
| public class WriteTest | |
| { | |
| public void RefArgument<T>(ref T t) { } | |
| public void LocalVariable() |
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 void Run(ITreeNode element, ElementProblemAnalyzerData data, IHighlightingConsumer consumer) | |
| { | |
| var prefixOperatorExpression = element as IPrefixOperatorExpression; | |
| if (prefixOperatorExpression != null) | |
| { | |
| switch (prefixOperatorExpression.PrefixOperatorType) | |
| { | |
| case PrefixOperatorType.PLUSPLUS: | |
| case PrefixOperatorType.MINUSMINUS: | |
| { |
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
| [Pure] | |
| private static bool HasContainingUnclosedBlocks([NotNull] ILocalFunctionDeclaration localFunctionDeclaration) | |
| { | |
| foreach (var containingNode in localFunctionDeclaration.ContainingNodes()) | |
| { | |
| var containingBlock = containingNode as IBlock; | |
| if (containingBlock != null && containingBlock.RBrace == null) return true; | |
| var switchBlock = containingNode as ISwitchBlock; | |
| if (switchBlock != null && switchBlock.RBrace == null) return true; |
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 delegate ref int RefIntFunc(); | |
| public delegate ref T RefFunc<T>(); | |
| public delegate ref TReturn RefFunc<T, TReturn>(T arg); | |
| public delegate ref TReturn RefFunc<T1, T2, TReturn>(T1 arg1, T2 arg2); | |
| public interface IWithRefReturns { | |
| ref int RefIntMethod(); | |
| ref string RefStringMethod(); | |
| ref int RefIntProperty { get; } |
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 (from.PrevSibling != null && from.PrevSibling.GetTokenType() == CSharpTokenType.WHITE_SPACE) | |
| from = from.PrevSibling; |
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 void Run(ITreeNode element, ElementProblemAnalyzerData data, IHighlightingConsumer consumer) | |
| { | |
| var ifStatement = element as IIfStatement; | |
| if (ifStatement != null) | |
| { | |
| CheckCondition(ifStatement.Condition, consumer); | |
| return; | |
| } | |
| var whileStatement = element as IWhileStatement; |
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 string Text | |
| { | |
| get | |
| { | |
| if ((myValue == ConstantExpressionValue.TRUE && | |
| (ConditionalAndExpressionNavigator.GetByLeftOperand(myExpression) != null || | |
| ConditionalAndExpressionNavigator.GetByRightOperand(myExpression) != null)) | |
| || | |
| (myValue == ConstantExpressionValue.FALSE && | |
| (ConditionalOrExpressionNavigator.GetByRightOperand(myExpression) != 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
| using System; | |
| public class C { | |
| public void M() { | |
| bool b; | |
| if (b = true) { } | |
| while (b = true) { } |