added JS support for toSet() and fixed issue with code generated array methods

This commit is contained in:
James Strachan
2012-06-23 07:49:15 +01:00
parent 4a4cf0467f
commit c8a1ffe813
25 changed files with 42 additions and 121 deletions
@@ -257,6 +257,9 @@ public inline fun DoubleArray.toList() : List<Double> = toCollection(ArrayList<
/** Copies all elements into a [[List] */
public inline fun DoubleArray.toCollection() : Collection<Double> = toCollection(ArrayList<Double>())
/** Copies all elements into a [[Set]] */
public inline fun DoubleArray.toSet() : Set<Double> = toCollection(HashSet<Double>())
/**
TODO figure out necessary variance/generics ninja stuff... :)
public inline fun DoubleArray.toSortedList(transform: fun(Double) : java.lang.Comparable<*>) : List<Double> {
@@ -276,9 +279,6 @@ public inline fun DoubleArray.toSortedList(transform: fun(Double) : java.lang.C
import java.util.*
/** Copies all elements into a [[Set]] */
public inline fun DoubleArray.toSet() : Set<Double> = toCollection(HashSet<Double>())
/** Copies all elements into a [[SortedSet]] */
public inline fun DoubleArray.toSortedSet() : SortedSet<Double> = toCollection(TreeSet<Double>())