Details
Description
When compiling for loops, the compiler always calls IEnumerable.GetEnumerator. When the enumerable implements IEnumerable of T, the compiler should use the generic version to avoid casting or unboxing.
For example:
for i in List of int():
print i
MSIL shows "callvirt IEnumerable.GetEnumerator()" and then "unbox valuetype System.Int32".
Should compile to "callvirt IEnumerable`1<System.Int32>.GetEnumerator()" and no unboxing or casting.
Issue Links
| This issue relates to: | ||||
| BOO-962 | Use ValueType Iterators |
|
|
|
| BOO-755 | Type inference for IEnumerable of T |
|
|
|
| This issue is related to: | ||||
| BOO-1053 | Refactor ProcessInheritedAbstractMembers step |
|
|
|
| This issue depends upon: | ||||
| BOO-1031 | Conflict when an explicitely implemented method has a sibling overload with incompatible signature |
|
|
|
We need
BOO-1031fixed first for this to work (and hmm really it looks quite complex and stress the need for a refactoring of ProcessInheritedAbstractMembers.. :/ )BOO-1031fixed first for this to work (and hmm really it looks quite complex and stress the need for a refactoring of ProcessInheritedAbstractMembers.. :/ )