fork download
  1. using System;
  2.  
  3. namespace Articulos.Cap04
  4. {
  5. public delegate void Delegado1();
  6. public delegate void Delegado2();
  7.  
  8. public class Aplicacion
  9. {
  10. public static void Main()
  11. {
  12. Delegado1 d1 = Metodo;
  13. // GenerarĂ¡ el error CS0029:
  14. // Cannot implicitly convert type...:
  15. Delegado2 d2 = d1;
  16. }
  17.  
  18. public static void Metodo()
  19. {
  20. Console.WriteLine("Metodo");
  21. }
  22. }
  23. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cs(15,23): error CS0029: Cannot implicitly convert type `Articulos.Cap04.Delegado1' to `Articulos.Cap04.Delegado2'
Compilation failed: 1 error(s), 0 warnings
stdout
Standard output is empty