Question IDE 0017 e IDE 0059

BrunoB

Well-known member
Joined
Nov 19, 2022
Messages
96
Programming Experience
Beginner
Hello, good evening. I know there are other posts about this error, but unfortunately it is not clear to me what I am failing. I leave the code, thanks.
PD;I want to show the elements inside the "flyable" collection

C#:
usingSystem;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace INHERITANCE3
{
     Class Program
     {
         static void Main(string[] args)
         {
             Cat g1 = new Cat();
             g1.Name = " Pepe";

             Dog p1 = new Dog();

             List<Animal> animals = new List<Animal>();
             animals.Add(g1);
             animals.Add(p1);
             animals.Add(new Fish());
             animals.Add(new Canary());
             animals.Add(new Eagle());


             foreach (var item in animals)
             {
                 Console.WriteLine(item.communicate());
             }
 

             List<Flyable> listavoladores = new List<Flyable>();//is not an object
             flyinglist.Add(new Canary());
             flyinglist.Add(new Eagle());


             foreach (Flyable item in flyerlist)
             {
                 Console.WriteLine();
             }


             Console.ReadKey();

         }
     }
}
 
Last edited:
The warnings with the IDE prefixes are just suggestions being made by the IDE to try to make your code cleaner. They are not programming errors than you need to address if you don't want to.

Just like in the past when you were referring to the Microsoft documentation for the errors, you can do the same for these warnings as well.
 
VS will also suggest to fix these warnings for you and rearrange the code.

1676367950066.png


1676368204952.png



1676368085854.png
 
The three dots ... is the standard highlighting for these. You can see that in each of the three samples I posted.
 
Back
Top Bottom