File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed
CSharp/Test/Syntax/Diagnostics Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -2042,6 +2042,25 @@ public static int Main()
20422042 Assert . Equal ( 1 , compilation . GetDiagnostics ( ) . Length ) ;
20432043 }
20442044
2045+ [ Fact ]
2046+ public void TestArgumentEquality ( )
2047+ {
2048+ var text = @"
2049+ using System;
2050+
2051+ public class Test
2052+ {
2053+ public static void Main()
2054+ {
2055+ (Console).WriteLine();
2056+ }
2057+ }" ;
2058+ var tree = Parse ( text ) ;
2059+
2060+ // (8,10): error CS0119: 'Console' is a type, which is not valid in the given context
2061+ AssertEx . Equal ( CreateCompilationWithMscorlib ( tree ) . GetDiagnostics ( ) , CreateCompilationWithMscorlib ( tree ) . GetDiagnostics ( ) ) ;
2062+ }
2063+
20452064 #region Mocks
20462065 internal class CustomErrorInfo : DiagnosticInfo
20472066 {
Original file line number Diff line number Diff line change @@ -437,7 +437,7 @@ public override bool Equals(object obj)
437437 result = true ;
438438 for ( int i = 0 ; i < _arguments . Length ; i ++ )
439439 {
440- if ( _arguments [ i ] != other . _arguments [ i ] )
440+ if ( ! object . Equals ( _arguments [ i ] , other . _arguments [ i ] ) )
441441 {
442442 result = false ;
443443 break ;
You can’t perform that action at this time.
0 commit comments