-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
YamlList needs to take type parameters? #36
Comments
I worked around this by using (This is not important, just me doing some fun hacking over the holidays.) |
This warning is correct—there's no guarantee that the elements of var yamlItems = yamlMob['items'];
if (yamlItems != null) {
yamlItems.forEach(
(itemName) => mob.addItem(creator.items.itemByName(itemName as String)));
} |
(Before your reply) I ended up writing it as: List<String> yamlItems = yamlMob['items'];
if (yamlItems != null) {
yamlItems.forEach(
(String itemName) => mob.addItem(creator.items.itemByName(itemName)));
} I'm not sure if that's better or worse, but it seems to compile and run with the default options in at least the latest dart 2.0 devel brew release. |
Nm, I had already written that above, my bad. |
I'm attempting to make some of my code strong-mode clean.
For example:
Complains:
If this were a normal list, I'd fix it by using:
List<String> items
But I can't do that for YamlList, even thought it implements ListMixin which takes a type parameter:
abstract class ListMixin<E> implements List<E> {
The text was updated successfully, but these errors were encountered: