You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I know that parameterized type is optional and that for example List is a shorthand for List<dynamic> but when I declare a class with a parameterized type?
I think that the following example is a bug:
abstractclassNumList<Textendsnum> implementsList<T> {
}
abstractclassDefNumListimplementsNumList<num> {
}
main() {
NumList<num> numList;
numList.add("10"); // ERROR
numList.add(10); // OKNumList numList2;
numList2.add("10"); // OK??? why, the base parameterized type is num not dynamic...
numList2.add(10); // OKDefNumList numList3;
numList3.add("10"); // ERROR
numList3.add(10); // OK
}
The text was updated successfully, but these errors were encountered:
I know that parameterized type is optional and that for example List is a shorthand for
List<dynamic>
but when I declare a class with a parameterized type?I think that the following example is a bug:
The text was updated successfully, but these errors were encountered: