diff options
Diffstat (limited to 'examples')
-rw-r--r-- | examples/dotty-example/README.md | 3 | ||||
-rw-r--r-- | examples/dotty-example/build/build.scala | 2 | ||||
-rw-r--r-- | examples/dotty-example/src/Main.scala | 11 |
3 files changed, 16 insertions, 0 deletions
diff --git a/examples/dotty-example/README.md b/examples/dotty-example/README.md new file mode 100644 index 0000000..bc0f6b0 --- /dev/null +++ b/examples/dotty-example/README.md @@ -0,0 +1,3 @@ +Dotty example project compiling hello world with the next version of Scala. + +All you need to do to enable Dotty is `extends Dotty` in your build.scala . diff --git a/examples/dotty-example/build/build.scala b/examples/dotty-example/build/build.scala new file mode 100644 index 0000000..eb67d93 --- /dev/null +++ b/examples/dotty-example/build/build.scala @@ -0,0 +1,2 @@ +import cbt._ +class Build(val context: Context) extends Dotty diff --git a/examples/dotty-example/src/Main.scala b/examples/dotty-example/src/Main.scala new file mode 100644 index 0000000..1963b51 --- /dev/null +++ b/examples/dotty-example/src/Main.scala @@ -0,0 +1,11 @@ +object Main extends Foo("Hello Dotty - trait parameters, yay"){ + def main(args: Array[String]) = { + println(hello) + + // Sanity check the classpath: this won't run if the dotty jar is not present. + val x: Int => Int = z => z + x(1) + } +} + +trait Foo(val hello: String) |