Errata: MVA, 201303_CSharp

Nov 27, 2013 at 8:18 PM

RE: Project: After001, File: Program.cs

Method "List()" is a example method that does not useful work, and presumably is placed in the file as a example of what can NOT be done in assigning a string to a strongly typed (int) collection ("List<>"). Suggest comments to clarify that the code can NOT compile as currently written.

Suggest change from:
  var list = new List<int>();
  list.Add(1);
  list.Add(2);
  list.Add("three");
to:
  var list = new List<int>();
  list.Add(1);
  list.Add(2);
  // The following line will break compile!
  list.Add("three");
Coordinator
Oct 8, 2014 at 3:44 AM
Suggestion noted. I'll try to find time. Good idea.
Marked as answer by JerryNixon on 10/7/2014 at 7:47 PM