PageRenderTime 42ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/Tests/SimpleTestCases/OverloadedMixedGenericAndNonGeneric.cs

http://github.com/kevingadd/JSIL
C# | 31 lines | 26 code | 5 blank | 0 comment | 0 complexity | 22c5f2219e537994f30e8d6584241cd8 MD5 | raw file
Possible License(s): CC-BY-SA-3.0
  1. using System;
  2. using System.Collections.Generic;
  3. public static class CommonExtensionMethodsSimple {
  4. public static void IsNullOrEmpty<T> (this IEnumerable<T> items) {
  5. Console.WriteLine("IsNullOrEmpty with 1 parameters");
  6. }
  7. public static void IsNullOrEmpty<T> (this IEnumerable<T> items, Func<T, bool> expression) {
  8. Console.WriteLine("IsNullOrEmpty with 2 parameters");
  9. }
  10. public static bool IsNullOrEmpty (this string items) // If you comment this one out, the test will pass
  11. {
  12. Console.WriteLine("IsNullOrEmpty string");
  13. return String.IsNullOrEmpty(items);
  14. }
  15. }
  16. public static class Program {
  17. public static IEnumerable<string> GetSomeStrings () {
  18. yield return "aaaa";
  19. yield return "bbb";
  20. }
  21. public static void Main (string[] args) {
  22. IEnumerable<string> en = GetSomeStrings();
  23. en.IsNullOrEmpty();
  24. Console.WriteLine("Done");
  25. }
  26. }