Browse Source
Fixes markup warnings (#6525 )
* fixes: suppress warning CS0659 Type overrides Object.Equals(object o) but does not override Object.GetHashCode()
* fixes: Warning CS0108 'AvaloniaXamlIlCompiler._configuration' hides inherited member 'XamlCompiler<IXamlILEmitter, XamlILNodeEmitResult>._configuration'. Use the new keyword if hiding was intended.
* fixes: Warning CS8765 Nullability of type of parameter 'obj' doesn't match overridden member.
pull/6675/head
workgroupengineering
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with
6 additions and
5 deletions
src/Avalonia.Visuals/Vector.cs
src/Markup/Avalonia.Markup.Xaml.Loader/CompilerExtensions/AvaloniaXamlIlCompiler.cs
src/Markup/Avalonia.Markup/Markup/Parsers/PropertyPathGrammar.cs
@ -175,7 +175,7 @@ namespace Avalonia
MathUtilities . AreClose ( _ y , other . _ y ) ;
}
public override bool Equals ( object obj ) = > obj is Vector other & & Equals ( other ) ;
public override bool Equals ( object? obj ) = > obj is Vector other & & Equals ( other ) ;
public override int GetHashCode ( )
{
@ -14,7 +14,6 @@ namespace Avalonia.Markup.Xaml.XamlIl.CompilerExtensions
{
class AvaloniaXamlIlCompiler : XamlILCompiler
{
private readonly TransformerConfiguration _ configuration ;
private readonly IXamlType _ contextType ;
private readonly AvaloniaXamlIlDesignPropertiesTransformer _d esignTransformer ;
private readonly AvaloniaBindingExtensionTransformer _ bindingTransformer ;
@ -22,8 +21,6 @@ namespace Avalonia.Markup.Xaml.XamlIl.CompilerExtensions
private AvaloniaXamlIlCompiler ( TransformerConfiguration configuration , XamlLanguageEmitMappings < IXamlILEmitter , XamlILNodeEmitResult > emitMappings )
: base ( configuration , emitMappings , true )
{
_ configuration = configuration ;
void InsertAfter < T > ( params IXamlAstTransformer [ ] t )
= > Transformers . InsertRange ( Transformers . FindIndex ( x = > x is T ) + 1 , t ) ;
@ -184,6 +184,9 @@ namespace Avalonia.Markup.Parsers
}
// Don't need to override GetHashCode as the ISyntax objects will not be stored in a hash; the
// only reason they have overridden Equals methods is for unit testing.
#pragma warning disable CS0659 // Type overrides Object.Equals(object o) but does not override Object.GetHashCode()
public class PropertySyntax : ISyntax
{
public string Name { get ; set ; } = string . Empty ;
@ -205,7 +208,7 @@ namespace Avalonia.Markup.Parsers
& & other . TypeName = = TypeName
& & other . TypeNamespace = = TypeNamespace ;
}
public class ChildTraversalSyntax : ISyntax
{
public static ChildTraversalSyntax Instance { get ; } = new ChildTraversalSyntax ( ) ;
@ -231,5 +234,6 @@ namespace Avalonia.Markup.Parsers
& & other . TypeName = = TypeName
& & other . TypeNamespace = = TypeNamespace ;
}
#pragma warning restore CS0659 // Type overrides Object.Equals(object o) but does not override Object.GetHashCode()
}
}