Skip to content

Instantly share code, notes, and snippets.

@capeterson
Created January 8, 2014 23:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save capeterson/8326438 to your computer and use it in GitHub Desktop.
Save capeterson/8326438 to your computer and use it in GitHub Desktop.
Apex List.addAll doesn't allow adding subclasses of the list's type properly.
List<SObject> l = new List<Sobject>();
l.addAll(new List<Contact>());
@capeterson
Copy link
Author

Results in a compile failure: Incompatible argument type LIST for All method on LIST

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment