Properly typecheck and compile invocations of generic methods.
Aligning the type parameters of the ifaces, impls, and methods correctly in typeck is almost brain surgery. Seems to work now for everything I threw at it, but might still break in other corner cases. Issue #1227
This commit is contained in:
@@ -742,6 +742,17 @@ fn iter<T>(v: [const T], f: block(T)) {
|
||||
iteri(v) { |_i, v| f(v) }
|
||||
}
|
||||
|
||||
/*
|
||||
Function: iter2
|
||||
|
||||
Iterates over two vectors in parallel
|
||||
|
||||
*/
|
||||
fn iter2<U, T>(v: [U], v2: [T], f: block(U, T)) {
|
||||
let i = 0;
|
||||
for elt in v { f(elt, v2[i]); i += 1; }
|
||||
}
|
||||
|
||||
/*
|
||||
Function: iteri
|
||||
|
||||
|
||||
Reference in New Issue
Block a user