/Tests/SimpleTestCases/OverloadedMixedGenericAndNonGeneric.cs
C# | 31 lines | 26 code | 5 blank | 0 comment | 0 complexity | 22c5f2219e537994f30e8d6584241cd8 MD5 | raw file
Possible License(s): CC-BY-SA-3.0
- using System;
- using System.Collections.Generic;
- public static class CommonExtensionMethodsSimple {
- public static void IsNullOrEmpty<T> (this IEnumerable<T> items) {
- Console.WriteLine("IsNullOrEmpty with 1 parameters");
- }
- public static void IsNullOrEmpty<T> (this IEnumerable<T> items, Func<T, bool> expression) {
- Console.WriteLine("IsNullOrEmpty with 2 parameters");
- }
- public static bool IsNullOrEmpty (this string items) // If you comment this one out, the test will pass
- {
- Console.WriteLine("IsNullOrEmpty string");
- return String.IsNullOrEmpty(items);
- }
- }
- public static class Program {
- public static IEnumerable<string> GetSomeStrings () {
- yield return "aaaa";
- yield return "bbb";
- }
- public static void Main (string[] args) {
- IEnumerable<string> en = GetSomeStrings();
- en.IsNullOrEmpty();
- Console.WriteLine("Done");
- }
- }