http://bugzilla.novell.com/show_bug.cgi?id=594905
http://bugzilla.novell.com/show_bug.cgi?id=594905#c0 Summary: Invalid Warnings generated: Warning CS1720: Expression will always cause a `System.NullReferenceException' Classification: Mono Product: Mono: Compilers Version: 2.6.x Platform: Macintosh OS/Version: Mac OS X 10.6 Status: NEW Severity: Normal Priority: P5 - None Component: C# AssignedTo: mono-bugs@lists.ximian.com ReportedBy: jojo.rudo...@gmail.com QAContact: mono-bugs@lists.ximian.com Found By: --- Blocker: Yes Occurs in conjunction with Extension Methods, that could very well handle null Arguments. Repro: (NUnit test case, will pass and thereby show the warning is incorrect) public static TSource MaxBy<TSource, TKey>(this IEnumerable<TSource> source, Func<TSource, TKey> selector) { if (source == null) throw new ArgumentNullException(); } [Test] [ExpectedException(typeof(ArgumentNullException))] public void MaxByNullSequence() { ((IEnumerable<string>)null).MaxBy(x => x.Length); } CSC does not generate this warning, this should be the expected behavior. -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA contact for the bug. You are the assignee for the bug. _______________________________________________ mono-bugs maillist - mono-bugs@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-bugs