The following code breaks when I run the map at the injecting mapscript phase
package Tmp
import LinkedList
public interface Function<S, R>
function call(S s) returns R
public interface Predicate<S> extends Function<S, bool>
public function every<T>(Predicate<T> predicate, LinkedList<T> list) returns bool
let iter = list.iterator()
for elem from iter
if not predicate.call(elem)
return false
iter.close()
return true
public function every<T>(Predicate<T> predicate) returns Predicate<LinkedList<T>>
return list -> every(predicate, list)
public function LinkedList<T>.every<T>(Predicate<T> predicate) returns bool
return every(predicate, this)
init
asList(1, 2, 3).every(x -> x >= 1)
I can fix it by not extending Function<S, bool> from Predicate<S>
package Tmp
import LinkedList
public interface Function<S, R>
function call(S s) returns R
public interface Predicate<S>
function call(S s) returns bool
public function every<T>(Predicate<T> predicate, LinkedList<T> list) returns bool
let iter = list.iterator()
for elem from iter
if not predicate.call(elem)
return false
iter.close()
return true
public function every<T>(Predicate<T> predicate) returns Predicate<LinkedList<T>>
return list -> every(predicate, list)
public function LinkedList<T>.every<T>(Predicate<T> predicate) returns bool
return every(predicate, this)
init
asList(1, 2, 3).every(x -> x >= 1)
The following code breaks when I run the map at the injecting mapscript phase
I can fix it by not extending
Function<S, bool>
fromPredicate<S>