In C# you can write:
using System.Numerics; namespace ExtensionTest { public static class MyExtensions { public static BigInteger Square(this BigInteger
This would be the code after Daniel's comment.
object MyExtensions { class RichInt( i: Int ) { def square = i * i } implicit def richInt( i: Int ) = new RichInt( i ) def main( args: Array[String] ) { println("The square of 2 is: " + 2.square ) } }