diff --git a/.editorconfig b/.editorconfig index 3de3e13f3..9516bd4f2 100644 --- a/.editorconfig +++ b/.editorconfig @@ -149,4 +149,11 @@ dotnet_naming_rule.private_fields_rule.symbols = private_fields_symbols dotnet_diagnostic.MEF006.severity = silent -dotnet_diagnostic.IDE2003.severity = silent \ No newline at end of file +dotnet_diagnostic.IDE2003.severity = silent + +#cleared null error types +dotnet_diagnostic.CS8765.severity = error +dotnet_diagnostic.CS8766.severity = error +dotnet_diagnostic.CS8767.severity = error +dotnet_diagnostic.CS8768.severity = error +dotnet_diagnostic.CS8769.severity = error diff --git a/ICSharpCode.Decompiler/CSharp/Resolver/CSharpConversions.cs b/ICSharpCode.Decompiler/CSharp/Resolver/CSharpConversions.cs index c45e273df..1d96a9bab 100644 --- a/ICSharpCode.Decompiler/CSharp/Resolver/CSharpConversions.cs +++ b/ICSharpCode.Decompiler/CSharp/Resolver/CSharpConversions.cs @@ -77,7 +77,7 @@ namespace ICSharpCode.Decompiler.CSharp.Resolver this.ToType = toType; } - public override bool Equals(object obj) + public override bool Equals(object? obj) { return (obj is TypePair) && Equals((TypePair)obj); } diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/AstNodeCollection.cs b/ICSharpCode.Decompiler/CSharp/Syntax/AstNodeCollection.cs index b3bd0edcc..d63e77884 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/AstNodeCollection.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/AstNodeCollection.cs @@ -200,7 +200,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return node.GetHashCode() ^ role.GetHashCode(); } - public override bool Equals(object obj) + public override bool Equals(object? obj) { AstNodeCollection? other = obj as AstNodeCollection; if (other == null) diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/AstType.cs b/ICSharpCode.Decompiler/CSharp/Syntax/AstType.cs index 779103c1f..74c0434e9 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/AstType.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/AstType.cs @@ -56,12 +56,12 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitNullNode(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { return other == null || other.IsNull; } - public override ITypeReference ToTypeReference(NameLookupMode lookupMode, InterningProvider interningProvider) + public override ITypeReference ToTypeReference(NameLookupMode lookupMode, InterningProvider? interningProvider) { return SpecialType.UnknownType; } @@ -102,12 +102,12 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitPatternPlaceholder(this, child, data); } - public override ITypeReference ToTypeReference(NameLookupMode lookupMode, InterningProvider interningProvider) + public override ITypeReference ToTypeReference(NameLookupMode lookupMode, InterningProvider? interningProvider) { throw new NotSupportedException(); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { return child.DoMatch(other, match); } diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/CSharpModifierToken.cs b/ICSharpCode.Decompiler/CSharp/Syntax/CSharpModifierToken.cs index 6e69f95bb..b3a45155b 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/CSharpModifierToken.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/CSharpModifierToken.cs @@ -49,12 +49,12 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax } } - public override string ToString(CSharpFormattingOptions formattingOptions) + public override string ToString(CSharpFormattingOptions? formattingOptions) { return GetModifierName(Modifier); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { CSharpModifierToken? o = other as CSharpModifierToken; return o != null && this.modifier == o.modifier; diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/CSharpTokenNode.cs b/ICSharpCode.Decompiler/CSharp/Syntax/CSharpTokenNode.cs index b954b7ea9..114ae9cb0 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/CSharpTokenNode.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/CSharpTokenNode.cs @@ -64,7 +64,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitNullNode(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { return other == null || other.IsNull; } @@ -107,7 +107,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax this.flags |= role.Index << AstNodeFlagsUsedBits; } - public override string ToString(CSharpFormattingOptions formattingOptions) + public override string ToString(CSharpFormattingOptions? formattingOptions) { uint tokenRoleIndex = (this.flags >> AstNodeFlagsUsedBits); if (Role.GetByIndex(tokenRoleIndex) is TokenRole r) @@ -132,7 +132,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitCSharpTokenNode(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { CSharpTokenNode? o = other as CSharpTokenNode; return o != null && !o.IsNull && !(o is CSharpModifierToken); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/ComposedType.cs b/ICSharpCode.Decompiler/CSharp/Syntax/ComposedType.cs index 518e4876f..8914430f9 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/ComposedType.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/ComposedType.cs @@ -144,7 +144,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitComposedType(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { ComposedType? o = other as ComposedType; return o != null @@ -156,7 +156,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax && this.ArraySpecifiers.DoMatch(o.ArraySpecifiers, match); } - public override string ToString(CSharpFormattingOptions formattingOptions) + public override string ToString(CSharpFormattingOptions? formattingOptions) { StringBuilder b = new StringBuilder(); if (this.HasRefSpecifier) @@ -287,13 +287,13 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitArraySpecifier(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { ArraySpecifier? o = other as ArraySpecifier; return o != null && this.Dimensions == o.Dimensions; } - public override string ToString(CSharpFormattingOptions formattingOptions) + public override string ToString(CSharpFormattingOptions? formattingOptions) { return "[" + new string(',', this.Dimensions - 1) + "]"; } diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/DocumentationReference.cs b/ICSharpCode.Decompiler/CSharp/Syntax/DocumentationReference.cs index f42da43c4..2293f8c70 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/DocumentationReference.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/DocumentationReference.cs @@ -109,7 +109,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax get { return GetChildrenByRole(Roles.Parameter); } } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { DocumentationReference? o = other as DocumentationReference; if (!(o != null && this.SymbolKind == o.SymbolKind && this.HasParameterList == o.HasParameterList)) diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/AnonymousMethodExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/AnonymousMethodExpression.cs index 9685f9e08..03ea04f44 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/AnonymousMethodExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/AnonymousMethodExpression.cs @@ -109,7 +109,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitAnonymousMethodExpression(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { AnonymousMethodExpression? o = other as AnonymousMethodExpression; return o != null && this.IsAsync == o.IsAsync && this.HasParameterList == o.HasParameterList diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/AnonymousTypeCreateExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/AnonymousTypeCreateExpression.cs index e74e2e1af..381276031 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/AnonymousTypeCreateExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/AnonymousTypeCreateExpression.cs @@ -81,7 +81,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitAnonymousTypeCreateExpression(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { var o = other as AnonymousTypeCreateExpression; return o != null && this.Initializers.DoMatch(o.Initializers, match); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/ArrayCreateExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/ArrayCreateExpression.cs index 5f20870e1..03559b43a 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/ArrayCreateExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/ArrayCreateExpression.cs @@ -69,7 +69,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitArrayCreateExpression(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { ArrayCreateExpression? o = other as ArrayCreateExpression; return o != null && this.Type.DoMatch(o.Type, match) diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/ArrayInitializerExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/ArrayInitializerExpression.cs index d7841c25a..ea15c49be 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/ArrayInitializerExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/ArrayInitializerExpression.cs @@ -85,7 +85,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitNullNode(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { return other == null || other.IsNull; } @@ -119,7 +119,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitArrayInitializerExpression(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { ArrayInitializerExpression? o = other as ArrayInitializerExpression; return o != null && this.Elements.DoMatch(o.Elements, match); @@ -176,7 +176,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitPatternPlaceholder(this, child, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { return child.DoMatch(other, match); } diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/AsExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/AsExpression.cs index 034879560..6303dac27 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/AsExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/AsExpression.cs @@ -73,7 +73,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitAsExpression(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { AsExpression? o = other as AsExpression; return o != null && this.Expression.DoMatch(o.Expression, match) && this.Type.DoMatch(o.Type, match); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/AssignmentExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/AssignmentExpression.cs index cee70016a..3fe7b3fa8 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/AssignmentExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/AssignmentExpression.cs @@ -103,7 +103,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitAssignmentExpression(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { AssignmentExpression? o = other as AssignmentExpression; return o != null && (this.Operator == AssignmentOperatorType.Any || this.Operator == o.Operator) diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/BaseReferenceExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/BaseReferenceExpression.cs index 46f916069..9076b1cfd 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/BaseReferenceExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/BaseReferenceExpression.cs @@ -63,7 +63,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitBaseReferenceExpression(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { BaseReferenceExpression? o = other as BaseReferenceExpression; return o != null; diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/BinaryOperatorExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/BinaryOperatorExpression.cs index e7d7f8f0a..db0d470ac 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/BinaryOperatorExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/BinaryOperatorExpression.cs @@ -105,7 +105,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitBinaryOperatorExpression(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { BinaryOperatorExpression? o = other as BinaryOperatorExpression; return o != null && (this.Operator == BinaryOperatorType.Any || this.Operator == o.Operator) diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/CastExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/CastExpression.cs index bb24ba1dc..20a78de71 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/CastExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/CastExpression.cs @@ -75,7 +75,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitCastExpression(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { CastExpression? o = other as CastExpression; return o != null && this.Type.DoMatch(o.Type, match) && this.Expression.DoMatch(o.Expression, match); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/CheckedExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/CheckedExpression.cs index 76cfa5ffa..313f18c7e 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/CheckedExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/CheckedExpression.cs @@ -75,7 +75,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitCheckedExpression(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { CheckedExpression? o = other as CheckedExpression; return o != null && this.Expression.DoMatch(o.Expression, match); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/ConditionalExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/ConditionalExpression.cs index 18d2dcd8b..94b19addb 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/ConditionalExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/ConditionalExpression.cs @@ -87,7 +87,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitConditionalExpression(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { ConditionalExpression? o = other as ConditionalExpression; return o != null && this.Condition.DoMatch(o.Condition, match) && this.TrueExpression.DoMatch(o.TrueExpression, match) && this.FalseExpression.DoMatch(o.FalseExpression, match); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/DeclarationExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/DeclarationExpression.cs index 558456524..37f4f2156 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/DeclarationExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/DeclarationExpression.cs @@ -50,7 +50,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitDeclarationExpression(this, data); } - protected internal override bool DoMatch(AstNode other, Match match) + protected internal override bool DoMatch(AstNode? other, Match match) { return other is DeclarationExpression o && Type.DoMatch(o.Type, match) diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/DefaultValueExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/DefaultValueExpression.cs index 21ee02d88..dd5eab75d 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/DefaultValueExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/DefaultValueExpression.cs @@ -75,7 +75,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitDefaultValueExpression(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { DefaultValueExpression? o = other as DefaultValueExpression; return o != null && this.Type.DoMatch(o.Type, match); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/DirectionExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/DirectionExpression.cs index e8e00f530..e26062f1f 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/DirectionExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/DirectionExpression.cs @@ -93,7 +93,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitDirectionExpression(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { DirectionExpression? o = other as DirectionExpression; return o != null && this.FieldDirection == o.FieldDirection && this.Expression.DoMatch(o.Expression, match); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/ErrorExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/ErrorExpression.cs index 89f9fcfdd..252ec224e 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/ErrorExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/ErrorExpression.cs @@ -72,7 +72,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitErrorNode(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { var o = other as ErrorExpression; return o != null; diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/Expression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/Expression.cs index c5d73352e..fe121170e 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/Expression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/Expression.cs @@ -56,7 +56,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitNullNode(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { return other == null || other.IsNull; } @@ -97,7 +97,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitPatternPlaceholder(this, child, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { return child.DoMatch(other, match); } diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/IdentifierExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/IdentifierExpression.cs index d1849ac1c..6205080d6 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/IdentifierExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/IdentifierExpression.cs @@ -79,7 +79,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitIdentifierExpression(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { IdentifierExpression? o = other as IdentifierExpression; return o != null && MatchString(this.Identifier, o.Identifier) && this.TypeArguments.DoMatch(o.TypeArguments, match); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/InterpolatedStringExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/InterpolatedStringExpression.cs index 6d3f2b5cc..332dc6f3f 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/InterpolatedStringExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/InterpolatedStringExpression.cs @@ -40,7 +40,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitInterpolatedStringExpression(this, data); } - protected internal override bool DoMatch(AstNode other, Match match) + protected internal override bool DoMatch(AstNode? other, Match match) { InterpolatedStringExpression? o = other as InterpolatedStringExpression; return o != null && !o.IsNull && this.Content.DoMatch(o.Content, match); @@ -75,7 +75,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitNullNode(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { return other == null || other.IsNull; } @@ -139,7 +139,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitInterpolation(this, data); } - protected internal override bool DoMatch(AstNode other, Match match) + protected internal override bool DoMatch(AstNode? other, Match match) { Interpolation? o = other as Interpolation; return o != null && this.Expression.DoMatch(o.Expression, match); @@ -175,7 +175,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitInterpolatedStringText(this, data); } - protected internal override bool DoMatch(AstNode other, Match match) + protected internal override bool DoMatch(AstNode? other, Match match) { InterpolatedStringText? o = other as InterpolatedStringText; return o != null && o.Text == this.Text; diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/InvocationExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/InvocationExpression.cs index 2d5a9c86e..3fbb984ff 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/InvocationExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/InvocationExpression.cs @@ -85,7 +85,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax { } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { InvocationExpression? o = other as InvocationExpression; return o != null && this.Target.DoMatch(o.Target, match) && this.Arguments.DoMatch(o.Arguments, match); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/IsExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/IsExpression.cs index 1801b42d9..c1c721571 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/IsExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/IsExpression.cs @@ -74,7 +74,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitIsExpression(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { IsExpression? o = other as IsExpression; return o != null && this.Expression.DoMatch(o.Expression, match) && this.Type.DoMatch(o.Type, match); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/LambdaExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/LambdaExpression.cs index e09e15709..8320f99c6 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/LambdaExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/LambdaExpression.cs @@ -82,7 +82,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitLambdaExpression(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { LambdaExpression? o = other as LambdaExpression; return o != null && this.IsAsync == o.IsAsync && this.Parameters.DoMatch(o.Parameters, match) && this.Body.DoMatch(o.Body, match); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/MemberReferenceExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/MemberReferenceExpression.cs index ad8754bb1..77afc0be0 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/MemberReferenceExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/MemberReferenceExpression.cs @@ -112,7 +112,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitMemberReferenceExpression(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { MemberReferenceExpression? o = other as MemberReferenceExpression; return o != null && this.Target.DoMatch(o.Target, match) && MatchString(this.MemberName, o.MemberName) && this.TypeArguments.DoMatch(o.TypeArguments, match); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/NamedArgumentExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/NamedArgumentExpression.cs index d2b66aa9a..eae728b50 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/NamedArgumentExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/NamedArgumentExpression.cs @@ -77,7 +77,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitNamedArgumentExpression(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { NamedArgumentExpression? o = other as NamedArgumentExpression; return o != null && MatchString(this.Name, o.Name) && this.Expression.DoMatch(o.Expression, match); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/NamedExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/NamedExpression.cs index d8fe23df8..768b6af42 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/NamedExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/NamedExpression.cs @@ -86,7 +86,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitNamedExpression(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { var o = other as NamedExpression; return o != null && MatchString(this.Name, o.Name) && this.Expression.DoMatch(o.Expression, match); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/NullReferenceExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/NullReferenceExpression.cs index df1351968..796e016f1 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/NullReferenceExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/NullReferenceExpression.cs @@ -75,7 +75,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitNullReferenceExpression(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { NullReferenceExpression? o = other as NullReferenceExpression; return o != null; diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/ObjectCreateExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/ObjectCreateExpression.cs index 64b89508f..4a71917fc 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/ObjectCreateExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/ObjectCreateExpression.cs @@ -97,7 +97,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitObjectCreateExpression(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { ObjectCreateExpression? o = other as ObjectCreateExpression; return o != null && this.Type.DoMatch(o.Type, match) && this.Arguments.DoMatch(o.Arguments, match) && this.Initializer.DoMatch(o.Initializer, match); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/OutVarDeclarationExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/OutVarDeclarationExpression.cs index 022987e80..4699a8f83 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/OutVarDeclarationExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/OutVarDeclarationExpression.cs @@ -64,7 +64,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitOutVarDeclarationExpression(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { var o = other as OutVarDeclarationExpression; return o != null && this.Type.DoMatch(o.Type, match) && this.Variable.DoMatch(o.Variable, match); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/ParenthesizedExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/ParenthesizedExpression.cs index 0758f0f3c..1e33acee0 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/ParenthesizedExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/ParenthesizedExpression.cs @@ -69,7 +69,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitParenthesizedExpression(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { ParenthesizedExpression? o = other as ParenthesizedExpression; return o != null && this.Expression.DoMatch(o.Expression, match); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/PointerReferenceExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/PointerReferenceExpression.cs index 724decd85..51987aec9 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/PointerReferenceExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/PointerReferenceExpression.cs @@ -80,7 +80,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitPointerReferenceExpression(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { PointerReferenceExpression? o = other as PointerReferenceExpression; return o != null && MatchString(this.MemberName, o.MemberName) && this.TypeArguments.DoMatch(o.TypeArguments, match); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/PrimitiveExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/PrimitiveExpression.cs index 3e0d356d7..0ba154a39 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/PrimitiveExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/PrimitiveExpression.cs @@ -143,7 +143,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return new TextLocation(line, col); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { PrimitiveExpression? o = other as PrimitiveExpression; return o != null && (this.Value == AnyValue || object.Equals(this.Value, o.Value)); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/QueryExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/QueryExpression.cs index f5139d97f..5093bc564 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/QueryExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/QueryExpression.cs @@ -48,7 +48,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitNullNode(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { return other == null || other.IsNull; } @@ -74,7 +74,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitQueryExpression(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { QueryExpression? o = other as QueryExpression; return o != null && !o.IsNull && this.Clauses.DoMatch(o.Clauses, match); @@ -148,7 +148,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitQueryContinuationClause(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { QueryContinuationClause? o = other as QueryContinuationClause; return o != null && MatchString(this.Identifier, o.Identifier) && this.PrecedingQuery.DoMatch(o.PrecedingQuery, match); @@ -206,7 +206,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitQueryFromClause(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { QueryFromClause? o = other as QueryFromClause; return o != null && this.Type.DoMatch(o.Type, match) && MatchString(this.Identifier, o.Identifier) @@ -259,7 +259,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitQueryLetClause(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { QueryLetClause? o = other as QueryLetClause; return o != null && MatchString(this.Identifier, o.Identifier) && this.Expression.DoMatch(o.Expression, match); @@ -295,7 +295,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitQueryWhereClause(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { QueryWhereClause? o = other as QueryWhereClause; return o != null && this.Condition.DoMatch(o.Condition, match); @@ -404,7 +404,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitQueryJoinClause(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { QueryJoinClause? o = other as QueryJoinClause; return o != null && this.IsGroupJoin == o.IsGroupJoin @@ -443,7 +443,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitQueryOrderClause(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { QueryOrderClause? o = other as QueryOrderClause; return o != null && this.Orderings.DoMatch(o.Orderings, match); @@ -488,7 +488,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitQueryOrdering(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { QueryOrdering? o = other as QueryOrdering; return o != null && this.Direction == o.Direction && this.Expression.DoMatch(o.Expression, match); @@ -530,7 +530,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitQuerySelectClause(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { QuerySelectClause? o = other as QuerySelectClause; return o != null && this.Expression.DoMatch(o.Expression, match); @@ -577,7 +577,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitQueryGroupClause(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { QueryGroupClause? o = other as QueryGroupClause; return o != null && this.Projection.DoMatch(o.Projection, match) && this.Key.DoMatch(o.Key, match); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/RecursivePatternExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/RecursivePatternExpression.cs index 3a26d735b..4c92a9341 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/RecursivePatternExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/RecursivePatternExpression.cs @@ -55,7 +55,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitRecursivePatternExpression(this, data); } - protected internal override bool DoMatch(AstNode other, Match match) + protected internal override bool DoMatch(AstNode? other, Match match) { return other is RecursivePatternExpression o && Type.DoMatch(o.Type, match) diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/SizeOfExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/SizeOfExpression.cs index 30e63b8e4..60e777361 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/SizeOfExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/SizeOfExpression.cs @@ -75,7 +75,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitSizeOfExpression(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { SizeOfExpression? o = other as SizeOfExpression; return o != null && this.Type.DoMatch(o.Type, match); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/StackAllocExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/StackAllocExpression.cs index 8633037f2..50d767324 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/StackAllocExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/StackAllocExpression.cs @@ -77,7 +77,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitStackAllocExpression(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { StackAllocExpression? o = other as StackAllocExpression; return o != null && this.Type.DoMatch(o.Type, match) diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/SwitchExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/SwitchExpression.cs index d39e63048..438202592 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/SwitchExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/SwitchExpression.cs @@ -63,7 +63,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitSwitchExpression(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { SwitchExpression? o = other as SwitchExpression; return o != null && this.Expression.DoMatch(o.Expression, match) && this.SwitchSections.DoMatch(o.SwitchSections, match); @@ -109,7 +109,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitSwitchExpressionSection(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { SwitchExpressionSection? o = other as SwitchExpressionSection; return o != null && this.Pattern.DoMatch(o.Pattern, match) && this.Body.DoMatch(o.Body, match); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/ThisReferenceExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/ThisReferenceExpression.cs index 0c42549ac..e82a4f0e5 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/ThisReferenceExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/ThisReferenceExpression.cs @@ -63,7 +63,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitThisReferenceExpression(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { ThisReferenceExpression? o = other as ThisReferenceExpression; return o != null; diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/ThrowExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/ThrowExpression.cs index 3aedc28e2..895ec32a6 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/ThrowExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/ThrowExpression.cs @@ -58,7 +58,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitThrowExpression(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { ThrowExpression? o = other as ThrowExpression; return o != null && this.Expression.DoMatch(o.Expression, match); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/TupleExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/TupleExpression.cs index 143726af4..bd1ed58af 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/TupleExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/TupleExpression.cs @@ -43,7 +43,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitTupleExpression(this, data); } - protected internal override bool DoMatch(AstNode other, Match match) + protected internal override bool DoMatch(AstNode? other, Match match) { return other is TupleExpression tuple && Elements.DoMatch(tuple.Elements, match); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/TypeOfExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/TypeOfExpression.cs index b81517eb4..4064708eb 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/TypeOfExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/TypeOfExpression.cs @@ -76,7 +76,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitTypeOfExpression(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { TypeOfExpression? o = other as TypeOfExpression; return o != null && this.Type.DoMatch(o.Type, match); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/TypeReferenceExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/TypeReferenceExpression.cs index 39f1b819c..eec542070 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/TypeReferenceExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/TypeReferenceExpression.cs @@ -54,7 +54,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax AddChild(type, Roles.Type); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { TypeReferenceExpression? o = other as TypeReferenceExpression; return o != null && this.Type.DoMatch(o.Type, match); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/UnaryOperatorExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/UnaryOperatorExpression.cs index 7e8086268..3052e1bf7 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/UnaryOperatorExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/UnaryOperatorExpression.cs @@ -87,7 +87,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitUnaryOperatorExpression(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { UnaryOperatorExpression? o = other as UnaryOperatorExpression; return o != null && (this.Operator == UnaryOperatorType.Any || this.Operator == o.Operator) diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/UncheckedExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/UncheckedExpression.cs index e21235b4c..f2ca9fd4e 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/UncheckedExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/UncheckedExpression.cs @@ -75,7 +75,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitUncheckedExpression(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { UncheckedExpression? o = other as UncheckedExpression; return o != null && this.Expression.DoMatch(o.Expression, match); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/UndocumentedExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/UndocumentedExpression.cs index aa7e5af7b..dbf6ea68c 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/UndocumentedExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/UndocumentedExpression.cs @@ -95,7 +95,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitUndocumentedExpression(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { UndocumentedExpression? o = other as UndocumentedExpression; return o != null && this.UndocumentedExpressionType == o.UndocumentedExpressionType && this.Arguments.DoMatch(o.Arguments, match); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/WithInitializerExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/WithInitializerExpression.cs index 809dfb367..3ff877de6 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/WithInitializerExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/WithInitializerExpression.cs @@ -57,7 +57,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitWithInitializerExpression(this, data); } - protected internal override bool DoMatch(AstNode other, Match match) + protected internal override bool DoMatch(AstNode? other, Match match) { return other is WithInitializerExpression o && this.Expression.DoMatch(o.Expression, match) diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/FunctionPointerAstType.cs b/ICSharpCode.Decompiler/CSharp/Syntax/FunctionPointerAstType.cs index 4259d3d7d..d5eab341c 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/FunctionPointerAstType.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/FunctionPointerAstType.cs @@ -66,7 +66,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitFunctionPointerType(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { return other is FunctionPointerAstType o && this.CallingConventions.DoMatch(o.CallingConventions, match) diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/Attribute.cs b/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/Attribute.cs index 901cbf7c9..3709476d6 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/Attribute.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/Attribute.cs @@ -77,13 +77,13 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitAttribute(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { Attribute? o = other as Attribute; return o != null && this.Type.DoMatch(o.Type, match) && this.Arguments.DoMatch(o.Arguments, match); } - public override string ToString(CSharpFormattingOptions formattingOptions) + public override string ToString(CSharpFormattingOptions? formattingOptions) { if (IsNull) return "Null"; diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/AttributeSection.cs b/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/AttributeSection.cs index 338e15a2c..fedcacd32 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/AttributeSection.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/AttributeSection.cs @@ -66,7 +66,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitPatternPlaceholder(this, child, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { return child.DoMatch(other, match); } @@ -129,7 +129,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitAttributeSection(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { AttributeSection? o = other as AttributeSection; return o != null && MatchString(this.AttributeTarget, o.AttributeTarget) && this.Attributes.DoMatch(o.Attributes, match); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/Comment.cs b/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/Comment.cs index b79956329..fc7783a41 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/Comment.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/Comment.cs @@ -143,7 +143,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitComment(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { Comment? o = other as Comment; return o != null && this.CommentType == o.CommentType && MatchString(this.Content, o.Content); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/Constraint.cs b/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/Constraint.cs index aac00ed52..ba88d9443 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/Constraint.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/Constraint.cs @@ -73,7 +73,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitConstraint(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { Constraint? o = other as Constraint; return o != null && this.TypeParameter.DoMatch(o.TypeParameter, match) && this.BaseTypes.DoMatch(o.BaseTypes, match); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/DelegateDeclaration.cs b/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/DelegateDeclaration.cs index 59803f5ca..f15538aa1 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/DelegateDeclaration.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/DelegateDeclaration.cs @@ -80,7 +80,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitDelegateDeclaration(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { DelegateDeclaration? o = other as DelegateDeclaration; return o != null && MatchString(this.Name, o.Name) diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/ExternAliasDeclaration.cs b/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/ExternAliasDeclaration.cs index 353e71f2c..c2fe80d66 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/ExternAliasDeclaration.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/ExternAliasDeclaration.cs @@ -83,7 +83,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitExternAliasDeclaration(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { var o = other as ExternAliasDeclaration; return o != null && MatchString(this.Name, o.Name); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/NamespaceDeclaration.cs b/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/NamespaceDeclaration.cs index 72fbc1c28..24ba4ab54 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/NamespaceDeclaration.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/NamespaceDeclaration.cs @@ -150,7 +150,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitNamespaceDeclaration(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { NamespaceDeclaration? o = other as NamespaceDeclaration; return o != null && MatchString(this.Name, o.Name) && this.Members.DoMatch(o.Members, match); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/PreProcessorDirective.cs b/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/PreProcessorDirective.cs index 767dbe1d2..cd5e9a1dc 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/PreProcessorDirective.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/PreProcessorDirective.cs @@ -193,7 +193,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitPreProcessorDirective(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { PreProcessorDirective? o = other as PreProcessorDirective; return o != null && Type == o.Type && MatchString(Argument, o.Argument); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/TypeDeclaration.cs b/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/TypeDeclaration.cs index 19e0074d2..115fd5dcc 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/TypeDeclaration.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/TypeDeclaration.cs @@ -147,7 +147,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitTypeDeclaration(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { TypeDeclaration? o = other as TypeDeclaration; return o != null && this.ClassType == o.ClassType && MatchString(this.Name, o.Name) diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/TypeParameterDeclaration.cs b/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/TypeParameterDeclaration.cs index 20cc0bd6e..3bb397607 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/TypeParameterDeclaration.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/TypeParameterDeclaration.cs @@ -104,7 +104,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitTypeParameterDeclaration(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { TypeParameterDeclaration? o = other as TypeParameterDeclaration; return o != null && this.Variance == o.Variance && MatchString(this.Name, o.Name) && this.Attributes.DoMatch(o.Attributes, match); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/UsingAliasDeclaration.cs b/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/UsingAliasDeclaration.cs index c0fc1c2b2..d9172161d 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/UsingAliasDeclaration.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/UsingAliasDeclaration.cs @@ -99,7 +99,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitUsingAliasDeclaration(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { UsingAliasDeclaration? o = other as UsingAliasDeclaration; return o != null && MatchString(this.Alias, o.Alias) && this.Import.DoMatch(o.Import, match); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/UsingDeclaration.cs b/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/UsingDeclaration.cs index a828b9239..966cae60c 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/UsingDeclaration.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/UsingDeclaration.cs @@ -115,7 +115,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitUsingDeclaration(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { UsingDeclaration? o = other as UsingDeclaration; return o != null && this.Import.DoMatch(o.Import, match); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Identifier.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Identifier.cs index 64c1a008b..1dc8c399f 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Identifier.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Identifier.cs @@ -54,7 +54,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitNullNode(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { return other == null || other.IsNull; } @@ -164,7 +164,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitIdentifier(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { Identifier? o = other as Identifier; return o != null && !o.IsNull && MatchString(this.Name, o.Name); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/InvocationAstType.cs b/ICSharpCode.Decompiler/CSharp/Syntax/InvocationAstType.cs index 99e529ba5..ad178e275 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/InvocationAstType.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/InvocationAstType.cs @@ -55,7 +55,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitInvocationType(this, data); } - protected internal override bool DoMatch(AstNode other, Match match) + protected internal override bool DoMatch(AstNode? other, Match match) { return other is InvocationAstType o && this.BaseType.DoMatch(o.BaseType, match) diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/MemberType.cs b/ICSharpCode.Decompiler/CSharp/Syntax/MemberType.cs index 74f02f5f3..bad911c0b 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/MemberType.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/MemberType.cs @@ -112,7 +112,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitMemberType(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { MemberType? o = other as MemberType; return o != null && this.IsDoubleColon == o.IsDoubleColon diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/PatternMatching/Pattern.cs b/ICSharpCode.Decompiler/CSharp/Syntax/PatternMatching/Pattern.cs index f644813f5..7e02f5063 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/PatternMatching/Pattern.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/PatternMatching/Pattern.cs @@ -31,7 +31,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax.PatternMatching /// public static readonly string AnyString = "$any$"; - public static bool MatchString(string pattern, string text) + public static bool MatchString(string? pattern, string? text) { return pattern == AnyString || pattern == text; } diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/PrimitiveType.cs b/ICSharpCode.Decompiler/CSharp/Syntax/PrimitiveType.cs index 8fa3cf943..cec4ba107 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/PrimitiveType.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/PrimitiveType.cs @@ -100,13 +100,13 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitPrimitiveType(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { PrimitiveType? o = other as PrimitiveType; return o != null && MatchString(this.Keyword, o.Keyword); } - public override string ToString(CSharpFormattingOptions formattingOptions) + public override string ToString(CSharpFormattingOptions? formattingOptions) { return Keyword; } diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/SimpleType.cs b/ICSharpCode.Decompiler/CSharp/Syntax/SimpleType.cs index df9808c93..231ba13e8 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/SimpleType.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/SimpleType.cs @@ -60,12 +60,12 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitNullNode(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { return other == null || other.IsNull; } - public override ITypeReference ToTypeReference(NameLookupMode lookupMode, InterningProvider interningProvider) + public override ITypeReference ToTypeReference(NameLookupMode lookupMode, InterningProvider? interningProvider) { return SpecialType.UnknownType; } @@ -141,7 +141,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitSimpleType(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { SimpleType? o = other as SimpleType; return o != null && MatchString(this.Identifier, o.Identifier) && this.TypeArguments.DoMatch(o.TypeArguments, match); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/BlockStatement.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/BlockStatement.cs index 1e2e9e873..5ef3ae374 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/BlockStatement.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/BlockStatement.cs @@ -60,7 +60,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitNullNode(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { return other == null || other.IsNull; } @@ -101,7 +101,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitPatternPlaceholder(this, child, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { return child.DoMatch(other, match); } @@ -140,7 +140,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitBlockStatement(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { BlockStatement? o = other as BlockStatement; return o != null && !o.IsNull && this.Statements.DoMatch(o.Statements, match); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/BreakStatement.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/BreakStatement.cs index cf3a735cd..81c0375f9 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/BreakStatement.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/BreakStatement.cs @@ -57,7 +57,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitBreakStatement(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { BreakStatement? o = other as BreakStatement; return o != null; diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/CheckedStatement.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/CheckedStatement.cs index 728a73abf..11e487210 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/CheckedStatement.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/CheckedStatement.cs @@ -67,7 +67,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitCheckedStatement(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { CheckedStatement? o = other as CheckedStatement; return o != null && this.Body.DoMatch(o.Body, match); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/ContinueStatement.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/ContinueStatement.cs index 23d674ce0..8fac0c894 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/ContinueStatement.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/ContinueStatement.cs @@ -57,7 +57,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitContinueStatement(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { ContinueStatement? o = other as ContinueStatement; return o != null; diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/DoWhileStatement.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/DoWhileStatement.cs index 17aa604cb..79c8a6a65 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/DoWhileStatement.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/DoWhileStatement.cs @@ -80,7 +80,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitDoWhileStatement(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { DoWhileStatement? o = other as DoWhileStatement; return o != null && this.EmbeddedStatement.DoMatch(o.EmbeddedStatement, match) && this.Condition.DoMatch(o.Condition, match); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/EmptyStatement.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/EmptyStatement.cs index c0fd1919c..d7ea9f661 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/EmptyStatement.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/EmptyStatement.cs @@ -64,7 +64,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitEmptyStatement(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { EmptyStatement? o = other as EmptyStatement; return o != null; diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/ExpressionStatement.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/ExpressionStatement.cs index 890a9fcd7..4c5a9ac77 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/ExpressionStatement.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/ExpressionStatement.cs @@ -65,7 +65,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax this.Expression = expression; } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { ExpressionStatement? o = other as ExpressionStatement; return o != null && this.Expression.DoMatch(o.Expression, match); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/FixedStatement.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/FixedStatement.cs index 1f62f6f4e..bfbb173a9 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/FixedStatement.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/FixedStatement.cs @@ -75,7 +75,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitFixedStatement(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { FixedStatement? o = other as FixedStatement; return o != null && this.Type.DoMatch(o.Type, match) && this.Variables.DoMatch(o.Variables, match) && this.EmbeddedStatement.DoMatch(o.EmbeddedStatement, match); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/ForStatement.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/ForStatement.cs index 6e63c8767..2a418afb1 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/ForStatement.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/ForStatement.cs @@ -86,7 +86,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitForStatement(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { ForStatement? o = other as ForStatement; return o != null && this.Initializers.DoMatch(o.Initializers, match) && this.Condition.DoMatch(o.Condition, match) diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/ForeachStatement.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/ForeachStatement.cs index f46b6e2b0..a6e39f1ae 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/ForeachStatement.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/ForeachStatement.cs @@ -96,7 +96,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitForeachStatement(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { ForeachStatement? o = other as ForeachStatement; return o != null && this.VariableType.DoMatch(o.VariableType, match) && this.VariableDesignation.DoMatch(o.VariableDesignation, match) diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/GotoStatement.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/GotoStatement.cs index 8f431d7d1..f5f28d40e 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/GotoStatement.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/GotoStatement.cs @@ -78,7 +78,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitGotoStatement(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { GotoStatement? o = other as GotoStatement; return o != null && MatchString(this.Label, o.Label); @@ -128,7 +128,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitGotoCaseStatement(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { GotoCaseStatement? o = other as GotoCaseStatement; return o != null && this.LabelExpression.DoMatch(o.LabelExpression, match); @@ -170,7 +170,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitGotoDefaultStatement(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { GotoDefaultStatement? o = other as GotoDefaultStatement; return o != null; diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/IfElseStatement.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/IfElseStatement.cs index 67e04b7cf..f7a3ab46f 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/IfElseStatement.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/IfElseStatement.cs @@ -84,7 +84,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitIfElseStatement(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { IfElseStatement? o = other as IfElseStatement; return o != null && this.Condition.DoMatch(o.Condition, match) && this.TrueStatement.DoMatch(o.TrueStatement, match) && this.FalseStatement.DoMatch(o.FalseStatement, match); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/LabelStatement.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/LabelStatement.cs index 2c2302fc8..8218b0a34 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/LabelStatement.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/LabelStatement.cs @@ -65,7 +65,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitLabelStatement(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { LabelStatement? o = other as LabelStatement; return o != null && MatchString(this.Label, o.Label); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/LocalFunctionDeclarationStatement.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/LocalFunctionDeclarationStatement.cs index da2d1550f..0a2f4ad26 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/LocalFunctionDeclarationStatement.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/LocalFunctionDeclarationStatement.cs @@ -49,7 +49,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitLocalFunctionDeclarationStatement(this, data); } - protected internal override bool DoMatch(AstNode other, Match match) + protected internal override bool DoMatch(AstNode? other, Match match) { return other is LocalFunctionDeclarationStatement o && Declaration.DoMatch(o.Declaration, match); } diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/LockStatement.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/LockStatement.cs index fb66fabab..c988127d7 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/LockStatement.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/LockStatement.cs @@ -71,7 +71,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitLockStatement(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { LockStatement? o = other as LockStatement; return o != null && this.Expression.DoMatch(o.Expression, match) && this.EmbeddedStatement.DoMatch(o.EmbeddedStatement, match); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/ReturnStatement.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/ReturnStatement.cs index 23da927ec..74b9dae6d 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/ReturnStatement.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/ReturnStatement.cs @@ -71,7 +71,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitReturnStatement(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { ReturnStatement? o = other as ReturnStatement; return o != null && this.Expression.DoMatch(o.Expression, match); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/Statement.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/Statement.cs index b278d1e3f..959431ad5 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/Statement.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/Statement.cs @@ -55,7 +55,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitNullNode(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { return other == null || other.IsNull; } @@ -96,7 +96,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitPatternPlaceholder(this, child, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { return child.DoMatch(other, match); } diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/SwitchStatement.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/SwitchStatement.cs index d714c1a72..364e6df94 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/SwitchStatement.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/SwitchStatement.cs @@ -79,7 +79,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitSwitchStatement(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { SwitchStatement? o = other as SwitchStatement; return o != null && this.Expression.DoMatch(o.Expression, match) && this.SwitchSections.DoMatch(o.SwitchSections, match); @@ -122,7 +122,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitPatternPlaceholder(this, child, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { return child.DoMatch(other, match); } @@ -165,7 +165,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitSwitchSection(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { SwitchSection? o = other as SwitchSection; return o != null && this.CaseLabels.DoMatch(o.CaseLabels, match) && this.Statements.DoMatch(o.Statements, match); @@ -219,7 +219,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitCaseLabel(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { CaseLabel? o = other as CaseLabel; return o != null && this.Expression.DoMatch(o.Expression, match); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/ThrowStatement.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/ThrowStatement.cs index 14cd2f5f7..cb6fc857f 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/ThrowStatement.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/ThrowStatement.cs @@ -71,7 +71,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitThrowStatement(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { ThrowStatement? o = other as ThrowStatement; return o != null && this.Expression.DoMatch(o.Expression, match); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/TryCatchStatement.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/TryCatchStatement.cs index e61537b37..a3352f0ff 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/TryCatchStatement.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/TryCatchStatement.cs @@ -75,7 +75,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitTryCatchStatement(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { TryCatchStatement? o = other as TryCatchStatement; return o != null && this.TryBlock.DoMatch(o.TryBlock, match) && this.CatchClauses.DoMatch(o.CatchClauses, match) && this.FinallyBlock.DoMatch(o.FinallyBlock, match); @@ -119,7 +119,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitNullNode(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { return other == null || other.IsNull; } @@ -160,7 +160,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitPatternPlaceholder(this, child, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { return child.DoMatch(other, match); } @@ -251,7 +251,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitCatchClause(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { CatchClause? o = other as CatchClause; return o != null && this.Type.DoMatch(o.Type, match) && MatchString(this.VariableName, o.VariableName) && this.Body.DoMatch(o.Body, match); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/UncheckedStatement.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/UncheckedStatement.cs index a74c3cb10..4b91caec5 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/UncheckedStatement.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/UncheckedStatement.cs @@ -67,7 +67,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitUncheckedStatement(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { UncheckedStatement? o = other as UncheckedStatement; return o != null && this.Body.DoMatch(o.Body, match); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/UnsafeStatement.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/UnsafeStatement.cs index 0c066b04b..afa19a96d 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/UnsafeStatement.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/UnsafeStatement.cs @@ -58,7 +58,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitUnsafeStatement(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { UnsafeStatement? o = other as UnsafeStatement; return o != null && this.Body.DoMatch(o.Body, match); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/UsingStatement.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/UsingStatement.cs index b4a910da3..2524726d3 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/UsingStatement.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/UsingStatement.cs @@ -87,7 +87,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitUsingStatement(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { UsingStatement? o = other as UsingStatement; return o != null && this.IsAsync == o.IsAsync && this.ResourceAcquisition.DoMatch(o.ResourceAcquisition, match) && this.EmbeddedStatement.DoMatch(o.EmbeddedStatement, match); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/VariableDeclarationStatement.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/VariableDeclarationStatement.cs index 3ac821ee7..15b58fa8e 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/VariableDeclarationStatement.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/VariableDeclarationStatement.cs @@ -79,7 +79,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitVariableDeclarationStatement(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { VariableDeclarationStatement? o = other as VariableDeclarationStatement; return o != null && this.Modifiers == o.Modifiers && this.Type.DoMatch(o.Type, match) && this.Variables.DoMatch(o.Variables, match); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/WhileStatement.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/WhileStatement.cs index 1d198abe4..5f9d8f80d 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/WhileStatement.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/WhileStatement.cs @@ -71,7 +71,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitWhileStatement(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { WhileStatement? o = other as WhileStatement; return o != null && this.Condition.DoMatch(o.Condition, match) && this.EmbeddedStatement.DoMatch(o.EmbeddedStatement, match); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/YieldBreakStatement.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/YieldBreakStatement.cs index 9dcc362f3..cfcd65162 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/YieldBreakStatement.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/YieldBreakStatement.cs @@ -62,7 +62,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitYieldBreakStatement(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { YieldBreakStatement? o = other as YieldBreakStatement; return o != null; diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/YieldReturnStatement.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/YieldReturnStatement.cs index a9c66d756..f741a9519 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/YieldReturnStatement.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/YieldReturnStatement.cs @@ -67,7 +67,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitYieldReturnStatement(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { YieldReturnStatement? o = other as YieldReturnStatement; return o != null && this.Expression.DoMatch(o.Expression, match); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/SyntaxTree.cs b/ICSharpCode.Decompiler/CSharp/Syntax/SyntaxTree.cs index 35d9e2a84..d4a0fed7b 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/SyntaxTree.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/SyntaxTree.cs @@ -117,7 +117,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { SyntaxTree? o = other as SyntaxTree; return o != null && this.Members.DoMatch(o.Members, match); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/TextLocation.cs b/ICSharpCode.Decompiler/CSharp/Syntax/TextLocation.cs index 487a9cc1c..307b13b53 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/TextLocation.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/TextLocation.cs @@ -98,7 +98,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// /// Equality test. /// - public override bool Equals(object obj) + public override bool Equals(object? obj) { if (!(obj is TextLocation)) return false; @@ -187,17 +187,17 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax public class TextLocationConverter : TypeConverter { - public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) + public override bool CanConvertFrom(ITypeDescriptorContext? context, Type sourceType) { return sourceType == typeof(string) || base.CanConvertFrom(context, sourceType); } - public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) + public override bool CanConvertTo(ITypeDescriptorContext? context, Type? destinationType) { return destinationType == typeof(TextLocation) || base.CanConvertTo(context, destinationType); } - public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value) + public override object? ConvertFrom(ITypeDescriptorContext? context, CultureInfo? culture, object value) { if (value is string) { @@ -210,7 +210,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return base.ConvertFrom(context, culture, value); } - public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) + public override object? ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType) { if (value is TextLocation) { diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/TupleAstType.cs b/ICSharpCode.Decompiler/CSharp/Syntax/TupleAstType.cs index 69b6c7fc2..c944f392f 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/TupleAstType.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/TupleAstType.cs @@ -57,7 +57,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax ); } - protected internal override bool DoMatch(AstNode other, Match match) + protected internal override bool DoMatch(AstNode? other, Match match) { return other is TupleAstType o && Elements.DoMatch(o.Elements, match); } @@ -91,7 +91,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitNullNode(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { return other == null || other.IsNull; } @@ -130,7 +130,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitTupleTypeElement(this, data); } - protected internal override bool DoMatch(AstNode other, Match match) + protected internal override bool DoMatch(AstNode? other, Match match) { return other is TupleTypeElement o && Type.DoMatch(o.Type, match) diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/Accessor.cs b/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/Accessor.cs index c5f628442..8b37f582c 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/Accessor.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/Accessor.cs @@ -57,7 +57,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitNullNode(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { return other == null || other.IsNull; } @@ -109,7 +109,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitAccessor(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { Accessor? o = other as Accessor; return o != null && !o.IsNull && this.MatchAttributesAndModifiers(o, match) && this.Body.DoMatch(o.Body, match); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/ConstructorDeclaration.cs b/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/ConstructorDeclaration.cs index 631027602..12d1a13e9 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/ConstructorDeclaration.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/ConstructorDeclaration.cs @@ -77,7 +77,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitConstructorDeclaration(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { ConstructorDeclaration? o = other as ConstructorDeclaration; return o != null && this.MatchAttributesAndModifiers(o, match) && this.Parameters.DoMatch(o.Parameters, match) @@ -127,7 +127,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitNullNode(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { return other == null || other.IsNull; } @@ -180,7 +180,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitConstructorInitializer(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { ConstructorInitializer? o = other as ConstructorInitializer; return o != null && !o.IsNull diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/DestructorDeclaration.cs b/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/DestructorDeclaration.cs index 648874d60..a11ddbce1 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/DestructorDeclaration.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/DestructorDeclaration.cs @@ -67,7 +67,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitDestructorDeclaration(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { DestructorDeclaration? o = other as DestructorDeclaration; return o != null && this.MatchAttributesAndModifiers(o, match) && this.Body.DoMatch(o.Body, match); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/EnumMemberDeclaration.cs b/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/EnumMemberDeclaration.cs index f6392f9ed..b4f58e628 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/EnumMemberDeclaration.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/EnumMemberDeclaration.cs @@ -60,7 +60,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitEnumMemberDeclaration(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { EnumMemberDeclaration? o = other as EnumMemberDeclaration; return o != null && this.MatchAttributesAndModifiers(o, match) diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/EventDeclaration.cs b/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/EventDeclaration.cs index 85c773aff..ff5ab3e54 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/EventDeclaration.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/EventDeclaration.cs @@ -76,7 +76,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitEventDeclaration(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { EventDeclaration? o = other as EventDeclaration; return o != null && this.MatchAttributesAndModifiers(o, match) @@ -139,7 +139,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitCustomEventDeclaration(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { CustomEventDeclaration? o = other as CustomEventDeclaration; return o != null && MatchString(this.Name, o.Name) diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/FieldDeclaration.cs b/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/FieldDeclaration.cs index 6bcf68626..933d7adc1 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/FieldDeclaration.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/FieldDeclaration.cs @@ -70,7 +70,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitFieldDeclaration(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { FieldDeclaration? o = other as FieldDeclaration; return o != null && this.MatchAttributesAndModifiers(o, match) diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/FixedFieldDeclaration.cs b/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/FixedFieldDeclaration.cs index 2d31d86ab..f803db180 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/FixedFieldDeclaration.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/FixedFieldDeclaration.cs @@ -59,7 +59,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitFixedFieldDeclaration(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { var o = other as FixedFieldDeclaration; return o != null && this.MatchAttributesAndModifiers(o, match) diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/FixedVariableInitializer.cs b/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/FixedVariableInitializer.cs index 97e61cea5..f6f71d346 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/FixedVariableInitializer.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/FixedVariableInitializer.cs @@ -94,7 +94,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitFixedVariableInitializer(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { var o = other as FixedVariableInitializer; return o != null && MatchString(this.Name, o.Name) && this.CountExpression.DoMatch(o.CountExpression, match); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/IndexerDeclaration.cs b/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/IndexerDeclaration.cs index fcbfb8713..b42b54a6e 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/IndexerDeclaration.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/IndexerDeclaration.cs @@ -116,7 +116,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitIndexerDeclaration(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { IndexerDeclaration? o = other as IndexerDeclaration; return o != null diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/MethodDeclaration.cs b/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/MethodDeclaration.cs index 07217b17e..bb86a18fd 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/MethodDeclaration.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/MethodDeclaration.cs @@ -90,7 +90,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitMethodDeclaration(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { MethodDeclaration? o = other as MethodDeclaration; return o != null && MatchString(this.Name, o.Name) diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/OperatorDeclaration.cs b/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/OperatorDeclaration.cs index 3f9f96b92..70343f3ac 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/OperatorDeclaration.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/OperatorDeclaration.cs @@ -353,7 +353,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax set { throw new NotSupportedException(); } } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { OperatorDeclaration? o = other as OperatorDeclaration; return o != null && this.MatchAttributesAndModifiers(o, match) diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/PropertyDeclaration.cs b/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/PropertyDeclaration.cs index 879fae19e..657cad0df 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/PropertyDeclaration.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/PropertyDeclaration.cs @@ -97,7 +97,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitPropertyDeclaration(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { PropertyDeclaration? o = other as PropertyDeclaration; return o != null && MatchString(this.Name, o.Name) diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/VariableInitializer.cs b/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/VariableInitializer.cs index 77eea3886..98768ede3 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/VariableInitializer.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/VariableInitializer.cs @@ -55,7 +55,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitNullNode(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { return other == null || other.IsNull; } @@ -96,7 +96,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitPatternPlaceholder(this, child, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { return child.DoMatch(other, match); } @@ -166,7 +166,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitVariableInitializer(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { VariableInitializer? o = other as VariableInitializer; return o != null && MatchString(this.Name, o.Name) && this.Initializer.DoMatch(o.Initializer, match); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/VariableDesignation.cs b/ICSharpCode.Decompiler/CSharp/Syntax/VariableDesignation.cs index 8d7991dec..9712d1a18 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/VariableDesignation.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/VariableDesignation.cs @@ -50,7 +50,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitNullNode(this, data); } - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) { return other == null || other.IsNull; } @@ -90,7 +90,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitSingleVariableDesignation(this, data); } - protected internal override bool DoMatch(AstNode other, Match match) + protected internal override bool DoMatch(AstNode? other, Match match) { return other is SingleVariableDesignation o && MatchString(this.Identifier, o.Identifier); } @@ -129,7 +129,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return visitor.VisitParenthesizedVariableDesignation(this, data); } - protected internal override bool DoMatch(AstNode other, Match match) + protected internal override bool DoMatch(AstNode? other, Match match) { return other is ParenthesizedVariableDesignation o && VariableDesignations.DoMatch(o.VariableDesignations, match); } diff --git a/ICSharpCode.Decompiler/Disassembler/OpCodeInfo.cs b/ICSharpCode.Decompiler/Disassembler/OpCodeInfo.cs index 931bc671d..a1748d780 100644 --- a/ICSharpCode.Decompiler/Disassembler/OpCodeInfo.cs +++ b/ICSharpCode.Decompiler/Disassembler/OpCodeInfo.cs @@ -48,7 +48,7 @@ namespace ICSharpCode.Decompiler.Disassembler public static bool operator ==(OpCodeInfo lhs, OpCodeInfo rhs) => lhs.Equals(rhs); public static bool operator !=(OpCodeInfo lhs, OpCodeInfo rhs) => !(lhs == rhs); - public override bool Equals(object obj) + public override bool Equals(object? obj) { if (obj is OpCodeInfo opCode) return Equals(opCode); diff --git a/ICSharpCode.Decompiler/Metadata/LightJson/JsonValue.cs b/ICSharpCode.Decompiler/Metadata/LightJson/JsonValue.cs index c79ac3459..17f203f34 100644 --- a/ICSharpCode.Decompiler/Metadata/LightJson/JsonValue.cs +++ b/ICSharpCode.Decompiler/Metadata/LightJson/JsonValue.cs @@ -764,7 +764,7 @@ namespace LightJson } /// - public override bool Equals(object obj) + public override bool Equals(object? obj) { if (obj == null) { diff --git a/ICSharpCode.Decompiler/Output/TextOutputWriter.cs b/ICSharpCode.Decompiler/Output/TextOutputWriter.cs index afd84cbbc..c2774d404 100644 --- a/ICSharpCode.Decompiler/Output/TextOutputWriter.cs +++ b/ICSharpCode.Decompiler/Output/TextOutputWriter.cs @@ -42,7 +42,7 @@ namespace ICSharpCode.Decompiler output.Write(value); } - public override void Write(string value) + public override void Write(string? value) { output.Write(value); } diff --git a/ICSharpCode.Decompiler/TypeSystem/ArrayType.cs b/ICSharpCode.Decompiler/TypeSystem/ArrayType.cs index f0d942d31..8c7a98b18 100644 --- a/ICSharpCode.Decompiler/TypeSystem/ArrayType.cs +++ b/ICSharpCode.Decompiler/TypeSystem/ArrayType.cs @@ -85,7 +85,7 @@ namespace ICSharpCode.Decompiler.TypeSystem return unchecked(elementType.GetHashCode() * 71681 + dimensions); } - public override bool Equals(IType other) + public override bool Equals(IType? other) { ArrayType? a = other as ArrayType; return a != null && elementType.Equals(a.elementType) && a.dimensions == dimensions && a.nullability == nullability; diff --git a/ICSharpCode.Decompiler/TypeSystem/AssemblyQualifiedTypeName.cs b/ICSharpCode.Decompiler/TypeSystem/AssemblyQualifiedTypeName.cs index 2643842f1..e819fd416 100644 --- a/ICSharpCode.Decompiler/TypeSystem/AssemblyQualifiedTypeName.cs +++ b/ICSharpCode.Decompiler/TypeSystem/AssemblyQualifiedTypeName.cs @@ -45,7 +45,7 @@ namespace ICSharpCode.Decompiler.TypeSystem return TypeName.ToString() + ", " + AssemblyName; } - public override bool Equals(object obj) + public override bool Equals(object? obj) { return (obj is AssemblyQualifiedTypeName) && Equals((AssemblyQualifiedTypeName)obj); } diff --git a/ICSharpCode.Decompiler/TypeSystem/ByReferenceType.cs b/ICSharpCode.Decompiler/TypeSystem/ByReferenceType.cs index c4d6796c1..4eda51b97 100644 --- a/ICSharpCode.Decompiler/TypeSystem/ByReferenceType.cs +++ b/ICSharpCode.Decompiler/TypeSystem/ByReferenceType.cs @@ -49,7 +49,7 @@ namespace ICSharpCode.Decompiler.TypeSystem return elementType.GetHashCode() ^ 91725813; } - public override bool Equals(IType other) + public override bool Equals(IType? other) { ByReferenceType? a = other as ByReferenceType; return a != null && elementType.Equals(a.elementType); diff --git a/ICSharpCode.Decompiler/TypeSystem/FullTypeName.cs b/ICSharpCode.Decompiler/TypeSystem/FullTypeName.cs index 36712ee64..74701a6ed 100644 --- a/ICSharpCode.Decompiler/TypeSystem/FullTypeName.cs +++ b/ICSharpCode.Decompiler/TypeSystem/FullTypeName.cs @@ -262,7 +262,7 @@ namespace ICSharpCode.Decompiler.TypeSystem } #region Equals and GetHashCode implementation - public override bool Equals(object obj) + public override bool Equals(object? obj) { return obj is FullTypeName && Equals((FullTypeName)obj); } diff --git a/ICSharpCode.Decompiler/TypeSystem/FunctionPointerType.cs b/ICSharpCode.Decompiler/TypeSystem/FunctionPointerType.cs index 6832fa9c2..babf67d83 100644 --- a/ICSharpCode.Decompiler/TypeSystem/FunctionPointerType.cs +++ b/ICSharpCode.Decompiler/TypeSystem/FunctionPointerType.cs @@ -179,7 +179,7 @@ namespace ICSharpCode.Decompiler.TypeSystem ParameterReferenceKinds); } - public override bool Equals(IType other) + public override bool Equals(IType? other) { return other is FunctionPointerType fpt && CallingConvention == fpt.CallingConvention diff --git a/ICSharpCode.Decompiler/TypeSystem/Implementation/MetadataTypeParameter.cs b/ICSharpCode.Decompiler/TypeSystem/Implementation/MetadataTypeParameter.cs index 282e5c2bf..36bf02a1f 100644 --- a/ICSharpCode.Decompiler/TypeSystem/Implementation/MetadataTypeParameter.cs +++ b/ICSharpCode.Decompiler/TypeSystem/Implementation/MetadataTypeParameter.cs @@ -251,7 +251,7 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation return 0x51fc5b83 ^ module.MetadataFile.GetHashCode() ^ handle.GetHashCode(); } - public override bool Equals(IType other) + public override bool Equals(IType? other) { return other is MetadataTypeParameter tp && handle == tp.handle && module.MetadataFile == tp.module.MetadataFile; } diff --git a/ICSharpCode.Decompiler/TypeSystem/IntersectionType.cs b/ICSharpCode.Decompiler/TypeSystem/IntersectionType.cs index c8a28fe11..02e6e4fa8 100644 --- a/ICSharpCode.Decompiler/TypeSystem/IntersectionType.cs +++ b/ICSharpCode.Decompiler/TypeSystem/IntersectionType.cs @@ -116,7 +116,7 @@ namespace ICSharpCode.Decompiler.TypeSystem return hashCode; } - public override bool Equals(IType other) + public override bool Equals(IType? other) { IntersectionType? o = other as IntersectionType; if (o != null && types.Count == o.types.Count) @@ -135,42 +135,42 @@ namespace ICSharpCode.Decompiler.TypeSystem get { return types; } } - public override IEnumerable GetMethods(Predicate filter, GetMemberOptions options) + public override IEnumerable GetMethods(Predicate? filter, GetMemberOptions options) { return GetMembersHelper.GetMethods(this, FilterNonStatic(filter), options); } - public override IEnumerable GetMethods(IReadOnlyList typeArguments, Predicate filter, GetMemberOptions options) + public override IEnumerable GetMethods(IReadOnlyList typeArguments, Predicate? filter, GetMemberOptions options) { return GetMembersHelper.GetMethods(this, typeArguments, filter, options); } - public override IEnumerable GetProperties(Predicate filter, GetMemberOptions options) + public override IEnumerable GetProperties(Predicate? filter, GetMemberOptions options) { return GetMembersHelper.GetProperties(this, FilterNonStatic(filter), options); } - public override IEnumerable GetFields(Predicate filter, GetMemberOptions options) + public override IEnumerable GetFields(Predicate? filter, GetMemberOptions options) { return GetMembersHelper.GetFields(this, FilterNonStatic(filter), options); } - public override IEnumerable GetEvents(Predicate filter, GetMemberOptions options) + public override IEnumerable GetEvents(Predicate? filter, GetMemberOptions options) { return GetMembersHelper.GetEvents(this, FilterNonStatic(filter), options); } - public override IEnumerable GetMembers(Predicate filter, GetMemberOptions options) + public override IEnumerable GetMembers(Predicate? filter, GetMemberOptions options) { return GetMembersHelper.GetMembers(this, FilterNonStatic(filter), options); } - public override IEnumerable GetAccessors(Predicate filter, GetMemberOptions options) + public override IEnumerable GetAccessors(Predicate? filter, GetMemberOptions options) { return GetMembersHelper.GetAccessors(this, FilterNonStatic(filter), options); } - static Predicate FilterNonStatic(Predicate filter) where T : class, IMember + static Predicate FilterNonStatic(Predicate? filter) where T : class, IMember { if (filter == null) return member => !member.IsStatic; diff --git a/ICSharpCode.Decompiler/TypeSystem/PointerType.cs b/ICSharpCode.Decompiler/TypeSystem/PointerType.cs index c5038e04f..fba8536ec 100644 --- a/ICSharpCode.Decompiler/TypeSystem/PointerType.cs +++ b/ICSharpCode.Decompiler/TypeSystem/PointerType.cs @@ -47,7 +47,7 @@ namespace ICSharpCode.Decompiler.TypeSystem return elementType.GetHashCode() ^ 91725811; } - public override bool Equals(IType other) + public override bool Equals(IType? other) { PointerType? a = other as PointerType; return a != null && elementType.Equals(a.elementType); diff --git a/ICSharpCode.Decompiler/TypeSystem/SpecialType.cs b/ICSharpCode.Decompiler/TypeSystem/SpecialType.cs index c7cf02428..489e0c97b 100644 --- a/ICSharpCode.Decompiler/TypeSystem/SpecialType.cs +++ b/ICSharpCode.Decompiler/TypeSystem/SpecialType.cs @@ -101,7 +101,7 @@ namespace ICSharpCode.Decompiler.TypeSystem #pragma warning disable 809 [Obsolete("Please compare special types using the kind property instead.")] - public override bool Equals(IType other) + public override bool Equals(IType? other) { // We consider a special types equal when they have equal types. // However, an unknown type with additional information is not considered to be equal to the SpecialType with TypeKind.Unknown. diff --git a/ICSharpCode.Decompiler/TypeSystem/TopLevelTypeName.cs b/ICSharpCode.Decompiler/TypeSystem/TopLevelTypeName.cs index d6039e150..5a20650c6 100644 --- a/ICSharpCode.Decompiler/TypeSystem/TopLevelTypeName.cs +++ b/ICSharpCode.Decompiler/TypeSystem/TopLevelTypeName.cs @@ -95,7 +95,7 @@ namespace ICSharpCode.Decompiler.TypeSystem return this.ReflectionName; } - public override bool Equals(object obj) + public override bool Equals(object? obj) { return (obj is TopLevelTypeName) && Equals((TopLevelTypeName)obj); } diff --git a/ICSharpCode.Decompiler/TypeSystem/TupleType.cs b/ICSharpCode.Decompiler/TypeSystem/TupleType.cs index 8bf805dec..4eab3d430 100644 --- a/ICSharpCode.Decompiler/TypeSystem/TupleType.cs +++ b/ICSharpCode.Decompiler/TypeSystem/TupleType.cs @@ -220,7 +220,7 @@ namespace ICSharpCode.Decompiler.TypeSystem public override string ReflectionName => UnderlyingType.ReflectionName; public override string Namespace => UnderlyingType.Namespace; - public override bool Equals(IType other) + public override bool Equals(IType? other) { var o = other as TupleType; if (o == null) diff --git a/ILSpy/AboutPage.cs b/ILSpy/AboutPage.cs index 43303bf88..0fbaa89ba 100644 --- a/ILSpy/AboutPage.cs +++ b/ILSpy/AboutPage.cs @@ -40,7 +40,7 @@ namespace ICSharpCode.ILSpy [PartCreationPolicy(CreationPolicy.Shared)] sealed class AboutPage : SimpleCommand { - public override void Execute(object parameter) + public override void Execute(object? parameter) { MainWindow.Instance.NavigateTo( new RequestNavigateEventArgs(new Uri("resource://aboutpage"), null), diff --git a/ILSpy/Analyzers/AnalyzeCommand.cs b/ILSpy/Analyzers/AnalyzeCommand.cs index 889e6afa0..65e2f3095 100644 --- a/ILSpy/Analyzers/AnalyzeCommand.cs +++ b/ILSpy/Analyzers/AnalyzeCommand.cs @@ -76,12 +76,12 @@ namespace ICSharpCode.ILSpy.Analyzers { private static readonly AnalyzerTreeViewModel AnalyzerTreeView = App.ExportProvider.GetExportedValue(); - public override bool CanExecute(object parameter) + public override bool CanExecute(object? parameter) { return MainWindow.Instance.SelectedNodes.All(n => n is IMemberTreeNode); } - public override void Execute(object parameter) + public override void Execute(object? parameter) { foreach (var node in MainWindow.Instance.SelectedNodes.OfType()) { diff --git a/ILSpy/Commands/CheckForUpdatesCommand.cs b/ILSpy/Commands/CheckForUpdatesCommand.cs index 58438c604..c5d1ee0bd 100644 --- a/ILSpy/Commands/CheckForUpdatesCommand.cs +++ b/ILSpy/Commands/CheckForUpdatesCommand.cs @@ -28,12 +28,12 @@ namespace ICSharpCode.ILSpy [PartCreationPolicy(CreationPolicy.Shared)] sealed class CheckForUpdatesCommand : SimpleCommand { - public override bool CanExecute(object parameter) + public override bool CanExecute(object? parameter) { return base.CanExecute(parameter); } - public override async void Execute(object parameter) + public override async void Execute(object? parameter) { await MainWindow.Instance.ShowMessageIfUpdatesAvailableAsync(ILSpySettings.Load(), forceCheck: true); } diff --git a/ILSpy/Commands/CommandWrapper.cs b/ILSpy/Commands/CommandWrapper.cs index 42b34ee05..2cf061b70 100644 --- a/ILSpy/Commands/CommandWrapper.cs +++ b/ILSpy/Commands/CommandWrapper.cs @@ -44,12 +44,12 @@ namespace ICSharpCode.ILSpy remove { wrappedCommand.CanExecuteChanged -= value; } } - public void Execute(object parameter) + public void Execute(object? parameter) { wrappedCommand.Execute(parameter); } - public bool CanExecute(object parameter) + public bool CanExecute(object? parameter) { return wrappedCommand.CanExecute(parameter); } diff --git a/ILSpy/Commands/DecompileAllCommand.cs b/ILSpy/Commands/DecompileAllCommand.cs index c905c9a87..84d53a41f 100644 --- a/ILSpy/Commands/DecompileAllCommand.cs +++ b/ILSpy/Commands/DecompileAllCommand.cs @@ -39,12 +39,12 @@ namespace ICSharpCode.ILSpy [PartCreationPolicy(CreationPolicy.Shared)] sealed class DecompileAllCommand : SimpleCommand { - public override bool CanExecute(object parameter) + public override bool CanExecute(object? parameter) { return System.IO.Directory.Exists("c:\\temp\\decompiled"); } - public override void Execute(object parameter) + public override void Execute(object? parameter) { Docking.DockWorkspace.Instance.RunWithCancellation(ct => Task.Factory.StartNew(() => { AvalonEditTextOutput output = new AvalonEditTextOutput(); @@ -92,7 +92,7 @@ namespace ICSharpCode.ILSpy [PartCreationPolicy(CreationPolicy.Shared)] sealed class Decompile100TimesCommand : SimpleCommand { - public override void Execute(object parameter) + public override void Execute(object? parameter) { const int numRuns = 100; var language = SettingsService.Instance.SessionSettings.LanguageSettings.Language; diff --git a/ILSpy/Commands/DelegateCommand.cs b/ILSpy/Commands/DelegateCommand.cs index 7e2516b1b..41996e327 100644 --- a/ILSpy/Commands/DelegateCommand.cs +++ b/ILSpy/Commands/DelegateCommand.cs @@ -28,12 +28,12 @@ namespace ICSharpCode.ILSpy.Commands this.canExecute = canExecute; } - public bool CanExecute(object parameter) + public bool CanExecute(object? parameter) { return canExecute(); } - public void Execute(object parameter) + public void Execute(object? parameter) { action(); } @@ -60,12 +60,12 @@ namespace ICSharpCode.ILSpy.Commands this.canExecute = canExecute; } - public bool CanExecute(object parameter) + public bool CanExecute(object? parameter) { return canExecute((T)parameter); } - public void Execute(object parameter) + public void Execute(object? parameter) { action((T)parameter); } diff --git a/ILSpy/Commands/DisassembleAllCommand.cs b/ILSpy/Commands/DisassembleAllCommand.cs index fc44d405a..42f1089e2 100644 --- a/ILSpy/Commands/DisassembleAllCommand.cs +++ b/ILSpy/Commands/DisassembleAllCommand.cs @@ -34,12 +34,12 @@ namespace ICSharpCode.ILSpy [PartCreationPolicy(CreationPolicy.Shared)] sealed class DisassembleAllCommand : SimpleCommand { - public override bool CanExecute(object parameter) + public override bool CanExecute(object? parameter) { return System.IO.Directory.Exists("c:\\temp\\disassembled"); } - public override void Execute(object parameter) + public override void Execute(object? parameter) { Docking.DockWorkspace.Instance.RunWithCancellation(ct => Task.Factory.StartNew(() => { AvalonEditTextOutput output = new AvalonEditTextOutput(); diff --git a/ILSpy/Commands/ExitCommand.cs b/ILSpy/Commands/ExitCommand.cs index fb475ef01..06873b6f8 100644 --- a/ILSpy/Commands/ExitCommand.cs +++ b/ILSpy/Commands/ExitCommand.cs @@ -25,7 +25,7 @@ namespace ICSharpCode.ILSpy [PartCreationPolicy(CreationPolicy.Shared)] sealed class ExitCommand : SimpleCommand { - public override void Execute(object parameter) + public override void Execute(object? parameter) { MainWindow.Instance.Close(); } diff --git a/ILSpy/Commands/GeneratePdbContextMenuEntry.cs b/ILSpy/Commands/GeneratePdbContextMenuEntry.cs index b7c3997d0..245fc7663 100644 --- a/ILSpy/Commands/GeneratePdbContextMenuEntry.cs +++ b/ILSpy/Commands/GeneratePdbContextMenuEntry.cs @@ -108,14 +108,14 @@ namespace ICSharpCode.ILSpy [PartCreationPolicy(CreationPolicy.Shared)] class GeneratePdbMainMenuEntry : SimpleCommand { - public override bool CanExecute(object parameter) + public override bool CanExecute(object? parameter) { return MainWindow.Instance.SelectedNodes?.Count() == 1 && MainWindow.Instance.SelectedNodes?.FirstOrDefault() is AssemblyTreeNode tn && !tn.LoadedAssembly.HasLoadError; } - public override void Execute(object parameter) + public override void Execute(object? parameter) { var assembly = (MainWindow.Instance.SelectedNodes?.FirstOrDefault() as AssemblyTreeNode)?.LoadedAssembly; if (assembly == null) diff --git a/ILSpy/Commands/ManageAssemblyListsCommand.cs b/ILSpy/Commands/ManageAssemblyListsCommand.cs index 0f2240e14..af5bf0465 100644 --- a/ILSpy/Commands/ManageAssemblyListsCommand.cs +++ b/ILSpy/Commands/ManageAssemblyListsCommand.cs @@ -27,7 +27,7 @@ namespace ICSharpCode.ILSpy [PartCreationPolicy(CreationPolicy.Shared)] sealed class ManageAssemblyListsCommand : SimpleCommand { - public override void Execute(object parameter) + public override void Execute(object? parameter) { ManageAssemblyListsDialog dlg = new ManageAssemblyListsDialog(); dlg.Owner = MainWindow.Instance; diff --git a/ILSpy/Commands/OpenFromGacCommand.cs b/ILSpy/Commands/OpenFromGacCommand.cs index 393e00eeb..a25fa14c0 100644 --- a/ILSpy/Commands/OpenFromGacCommand.cs +++ b/ILSpy/Commands/OpenFromGacCommand.cs @@ -27,12 +27,12 @@ namespace ICSharpCode.ILSpy [PartCreationPolicy(CreationPolicy.Shared)] sealed class OpenFromGacCommand : SimpleCommand { - public override bool CanExecute(object parameter) + public override bool CanExecute(object? parameter) { return AppEnvironment.IsWindows; } - public override void Execute(object parameter) + public override void Execute(object? parameter) { OpenFromGacDialog dlg = new OpenFromGacDialog(); dlg.Owner = MainWindow.Instance; diff --git a/ILSpy/Commands/Pdb2XmlCommand.cs b/ILSpy/Commands/Pdb2XmlCommand.cs index c69777370..2ddf9b384 100644 --- a/ILSpy/Commands/Pdb2XmlCommand.cs +++ b/ILSpy/Commands/Pdb2XmlCommand.cs @@ -38,14 +38,14 @@ namespace ICSharpCode.ILSpy [PartCreationPolicy(CreationPolicy.Shared)] sealed class Pdb2XmlCommand : SimpleCommand { - public override bool CanExecute(object parameter) + public override bool CanExecute(object? parameter) { var selectedNodes = MainWindow.Instance.SelectedNodes; return selectedNodes?.Any() == true && selectedNodes.All(n => n is AssemblyTreeNode asm && !asm.LoadedAssembly.HasLoadError); } - public override void Execute(object parameter) + public override void Execute(object? parameter) { Execute(MainWindow.Instance.SelectedNodes.OfType()); } diff --git a/ILSpy/Commands/RemoveAssembliesWithLoadErrors.cs b/ILSpy/Commands/RemoveAssembliesWithLoadErrors.cs index c8696104b..282c99098 100644 --- a/ILSpy/Commands/RemoveAssembliesWithLoadErrors.cs +++ b/ILSpy/Commands/RemoveAssembliesWithLoadErrors.cs @@ -27,12 +27,12 @@ namespace ICSharpCode.ILSpy [PartCreationPolicy(CreationPolicy.Shared)] class RemoveAssembliesWithLoadErrors : SimpleCommand { - public override bool CanExecute(object parameter) + public override bool CanExecute(object? parameter) { return MainWindow.Instance.CurrentAssemblyList?.GetAssemblies().Any(l => l.HasLoadError) == true; } - public override void Execute(object parameter) + public override void Execute(object? parameter) { foreach (var asm in MainWindow.Instance.CurrentAssemblyList.GetAssemblies()) { @@ -49,12 +49,12 @@ namespace ICSharpCode.ILSpy [PartCreationPolicy(CreationPolicy.Shared)] class ClearAssemblyList : SimpleCommand { - public override bool CanExecute(object parameter) + public override bool CanExecute(object? parameter) { return MainWindow.Instance.CurrentAssemblyList?.Count > 0; } - public override void Execute(object parameter) + public override void Execute(object? parameter) { MainWindow.Instance.CurrentAssemblyList?.Clear(); } diff --git a/ILSpy/Commands/SetThemeCommand.cs b/ILSpy/Commands/SetThemeCommand.cs index 2d1a0b32a..8822ed67a 100644 --- a/ILSpy/Commands/SetThemeCommand.cs +++ b/ILSpy/Commands/SetThemeCommand.cs @@ -4,7 +4,7 @@ namespace ICSharpCode.ILSpy.Commands { public class SetThemeCommand : SimpleCommand { - public override void Execute(object parameter) + public override void Execute(object? parameter) { if (parameter is string theme) SettingsService.Instance.SessionSettings.Theme = theme; diff --git a/ILSpy/Commands/ShowPane.cs b/ILSpy/Commands/ShowPane.cs index 372081e0b..de2f9adcf 100644 --- a/ILSpy/Commands/ShowPane.cs +++ b/ILSpy/Commands/ShowPane.cs @@ -13,7 +13,7 @@ namespace ICSharpCode.ILSpy.Commands this.contentId = contentId; } - public override void Execute(object parameter) + public override void Execute(object? parameter) { DockWorkspace.Instance.ShowToolPane(contentId); } @@ -28,7 +28,7 @@ namespace ICSharpCode.ILSpy.Commands this.model = model; } - public override void Execute(object parameter) + public override void Execute(object? parameter) { DockWorkspace.Instance.ActiveTabPage = model; } diff --git a/ILSpy/Commands/SimpleCommand.cs b/ILSpy/Commands/SimpleCommand.cs index 67c7f517e..502d7ea9f 100644 --- a/ILSpy/Commands/SimpleCommand.cs +++ b/ILSpy/Commands/SimpleCommand.cs @@ -29,9 +29,9 @@ namespace ICSharpCode.ILSpy remove { CommandManager.RequerySuggested -= value; } } - public abstract void Execute(object parameter); + public abstract void Execute(object? parameter); - public virtual bool CanExecute(object parameter) + public virtual bool CanExecute(object? parameter) { return true; } @@ -48,7 +48,7 @@ namespace ICSharpCode.ILSpy public event PropertyChangedEventHandler PropertyChanged; - void ICommand.Execute(object parameter) + void ICommand.Execute(object? parameter) { IsChecked = Execute(parameter); } @@ -64,9 +64,9 @@ namespace ICSharpCode.ILSpy } } - public abstract bool Execute(object parameter); + public abstract bool Execute(object? parameter); - public virtual bool CanExecute(object parameter) + public virtual bool CanExecute(object? parameter) { return true; } diff --git a/ILSpy/Commands/SortAssemblyListCommand.cs b/ILSpy/Commands/SortAssemblyListCommand.cs index 7621778a7..3e5bce4ae 100644 --- a/ILSpy/Commands/SortAssemblyListCommand.cs +++ b/ILSpy/Commands/SortAssemblyListCommand.cs @@ -31,13 +31,13 @@ namespace ICSharpCode.ILSpy [PartCreationPolicy(CreationPolicy.Shared)] sealed class SortAssemblyListCommand : SimpleCommand, IComparer { - public override void Execute(object parameter) + public override void Execute(object? parameter) { using (MainWindow.Instance.AssemblyTreeView.LockUpdates()) MainWindow.Instance.CurrentAssemblyList.Sort(this); } - int IComparer.Compare(LoadedAssembly x, LoadedAssembly y) + int IComparer.Compare(LoadedAssembly? x, LoadedAssembly? y) { return string.Compare(x.ShortName, y.ShortName, StringComparison.CurrentCulture); } @@ -48,7 +48,7 @@ namespace ICSharpCode.ILSpy [PartCreationPolicy(CreationPolicy.Shared)] sealed class CollapseAllCommand : SimpleCommand { - public override void Execute(object parameter) + public override void Execute(object? parameter) { using (MainWindow.Instance.AssemblyTreeView.LockUpdates()) CollapseChildren(MainWindow.Instance.AssemblyTreeView.Root); diff --git a/ILSpy/Docking/CloseAllDocumentsCommand.cs b/ILSpy/Docking/CloseAllDocumentsCommand.cs index 2c0ceb41b..273eda623 100644 --- a/ILSpy/Docking/CloseAllDocumentsCommand.cs +++ b/ILSpy/Docking/CloseAllDocumentsCommand.cs @@ -13,7 +13,7 @@ namespace ICSharpCode.ILSpy.Docking [PartCreationPolicy(CreationPolicy.Shared)] class CloseAllDocumentsCommand : SimpleCommand { - public override void Execute(object parameter) + public override void Execute(object? parameter) { DockWorkspace.Instance.CloseAllTabs(); } @@ -23,7 +23,7 @@ namespace ICSharpCode.ILSpy.Docking [PartCreationPolicy(CreationPolicy.Shared)] class ResetLayoutCommand : SimpleCommand { - public override void Execute(object parameter) + public override void Execute(object? parameter) { DockWorkspace.Instance.ResetLayout(); } diff --git a/ILSpy/Docking/TabPageGuardConverter.cs b/ILSpy/Docking/TabPageGuardConverter.cs index b6c2d2361..94a2f1b17 100644 --- a/ILSpy/Docking/TabPageGuardConverter.cs +++ b/ILSpy/Docking/TabPageGuardConverter.cs @@ -27,12 +27,12 @@ namespace ICSharpCode.ILSpy.Docking { public class TabPageGuardConverter : ValueConverter { - protected override object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) + protected override object Convert(object value, Type? targetType, object? parameter, System.Globalization.CultureInfo? culture) { return value is TabPageModel ? value : Binding.DoNothing; } - protected override object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) + protected override object ConvertBack(object value, Type? targetType, object? parameter, System.Globalization.CultureInfo? culture) { return value is TabPageModel ? value : Binding.DoNothing; } diff --git a/ILSpy/ILSpyTraceListener.cs b/ILSpy/ILSpyTraceListener.cs index 66bca5561..b68190b3b 100644 --- a/ILSpy/ILSpyTraceListener.cs +++ b/ILSpy/ILSpyTraceListener.cs @@ -43,12 +43,12 @@ namespace ICSharpCode.ILSpy HashSet ignoredStacks = new HashSet(); bool dialogIsOpen; - public override void Fail(string message) + public override void Fail(string? message) { this.Fail(message, null); } - public override void Fail(string message, string detailMessage) + public override void Fail(string? message, string? detailMessage) { base.Fail(message, detailMessage); // let base class write the assert to the debug console string topFrame = ""; diff --git a/ILSpy/Metadata/FlagsFilterControl.xaml.cs b/ILSpy/Metadata/FlagsFilterControl.xaml.cs index 7a8225a69..6ebaf42f4 100644 --- a/ILSpy/Metadata/FlagsFilterControl.xaml.cs +++ b/ILSpy/Metadata/FlagsFilterControl.xaml.cs @@ -114,7 +114,7 @@ namespace ICSharpCode.ILSpy.Metadata this.Mask = mask; } - public bool IsMatch(object value) + public bool IsMatch(object? value) { if (value == null) return true; diff --git a/ILSpy/Metadata/HexFilterControl.xaml.cs b/ILSpy/Metadata/HexFilterControl.xaml.cs index 26f4d5ea7..6c3a14217 100644 --- a/ILSpy/Metadata/HexFilterControl.xaml.cs +++ b/ILSpy/Metadata/HexFilterControl.xaml.cs @@ -71,7 +71,7 @@ namespace ICSharpCode.ILSpy.Metadata this.filter = filter; } - public bool IsMatch(object value) + public bool IsMatch(object? value) { if (string.IsNullOrWhiteSpace(filter)) return true; diff --git a/ILSpy/Metadata/MetaDataGrid.cs b/ILSpy/Metadata/MetaDataGrid.cs index a87b065e3..d9328842f 100644 --- a/ILSpy/Metadata/MetaDataGrid.cs +++ b/ILSpy/Metadata/MetaDataGrid.cs @@ -32,7 +32,7 @@ namespace ICSharpCode.ILSpy.Metadata class MetaDataGrid : DataGrid, IHaveState { private readonly MouseHoverLogic hoverLogic; - private ToolTip toolTip; + private ToolTip? toolTip; public ILSpyTreeNode SelectedTreeNode { get; set; } @@ -76,7 +76,7 @@ namespace ICSharpCode.ILSpy.Metadata var pi = data?.GetType().GetProperty(name + "Tooltip"); if (pi == null) return; - object tooltip = pi.GetValue(data); + object? tooltip = pi.GetValue(data); if (tooltip is string s) { if (string.IsNullOrWhiteSpace(s)) @@ -107,7 +107,7 @@ namespace ICSharpCode.ILSpy.Metadata } } - public ViewState GetState() + public ViewState? GetState() { return new ViewState { DecompiledNodes = SelectedTreeNode == null diff --git a/ILSpy/NavigationState.cs b/ILSpy/NavigationState.cs index e7400b40e..e30ee7f63 100644 --- a/ILSpy/NavigationState.cs +++ b/ILSpy/NavigationState.cs @@ -49,7 +49,7 @@ namespace ICSharpCode.ILSpy } - public bool Equals(NavigationState other) + public bool Equals(NavigationState? other) { if (!this.treeNodes.SetEquals(other.treeNodes)) return false; diff --git a/ILSpy/Options/OptionsDialog.xaml.cs b/ILSpy/Options/OptionsDialog.xaml.cs index 72413f672..c9226fdef 100644 --- a/ILSpy/Options/OptionsDialog.xaml.cs +++ b/ILSpy/Options/OptionsDialog.xaml.cs @@ -124,7 +124,7 @@ namespace ICSharpCode.ILSpy.Options [PartCreationPolicy(CreationPolicy.Shared)] sealed class ShowOptionsCommand : SimpleCommand { - public override void Execute(object parameter) + public override void Execute(object? parameter) { OptionsDialog dlg = new OptionsDialog(); dlg.Owner = MainWindow.Instance; diff --git a/ILSpy/ViewModels/PaneModel.cs b/ILSpy/ViewModels/PaneModel.cs index 8663688e4..eef9dca9f 100644 --- a/ILSpy/ViewModels/PaneModel.cs +++ b/ILSpy/ViewModels/PaneModel.cs @@ -49,12 +49,12 @@ namespace ICSharpCode.ILSpy.ViewModels public event EventHandler CanExecuteChanged; - public bool CanExecute(object parameter) + public bool CanExecute(object? parameter) { return model.IsCloseable; } - public void Execute(object parameter) + public void Execute(object? parameter) { Docking.DockWorkspace.Instance.Remove(model); } diff --git a/ILSpy/ViewModels/TabPageModel.cs b/ILSpy/ViewModels/TabPageModel.cs index 10c28d47c..7972b84b6 100644 --- a/ILSpy/ViewModels/TabPageModel.cs +++ b/ILSpy/ViewModels/TabPageModel.cs @@ -102,6 +102,6 @@ namespace ICSharpCode.ILSpy.ViewModels public interface IHaveState { - ViewState GetState(); + ViewState? GetState(); } } \ No newline at end of file