Working on the type checker

This commit is contained in:
Andrey Breslav
2011-01-20 19:28:36 +03:00
parent 04aa370fa6
commit 113a066e48
15 changed files with 153 additions and 14 deletions
@@ -1,6 +1,6 @@
type Comparison<in T> = {(T, T) : Int}
fun naturalOrder<in T : IComparable<T>>(a : T, b : T) : Int = a.compareTo(b)
fun naturalOrder<in T : Comparable<T>>(a : T, b : T) : Int = a.compareTo(b)
fun castingNaturalOrder(a : Object, b : Object) : Int = (a as Comparable<Object>).compareTo(b as Comparable<Object>)
@@ -1,3 +1,3 @@
interface class IComparable<in T> {
virtual class IComparable<in T> {
fun compareTo(other : T) : Int
}