Skip to content

Instantly share code, notes, and snippets.

@eungju
Last active May 18, 2016 04:13
Show Gist options
  • Save eungju/c04d6d686dae143fc86e0803a39a523d to your computer and use it in GitHub Desktop.
Save eungju/c04d6d686dae143fc86e0803a39a523d to your computer and use it in GitHub Desktop.
123 > "123"
GHCi, version 7.10.3: http://www.haskell.org/ghc/ :? for help
Prelude> let (>) :: Int -> String -> Bool; (>) a b = (compare a (length b)) == GT
Prelude> 123 > "123"
True
Prelude> 1 > "123"
False
import org.junit.Test
import kotlin.test.assertTrue
class TypeTest {
operator fun Int.compareTo(other: String): Int {
return 1
}
@Test
fun gt() {
assertTrue(123 > "123")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment