diff options
author | Jan Christopher Vogt <oss.nsp@cvogt.org> | 2016-09-28 21:29:26 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-28 21:29:26 -0400 |
commit | 9d3c9e9087a6dc0a4445f9428e02f6e7612470c6 (patch) | |
tree | ab1aef0726e71ff1ad760b6574489dc20b2d1950 /examples | |
parent | ab5ebf2577146b6d8e7c54db4d6bf9ba6230ab57 (diff) | |
parent | 9b4b9e0c7a747972229fe9dbabe4b6e546c29f4d (diff) | |
download | cbt-9d3c9e9087a6dc0a4445f9428e02f6e7612470c6.tar.gz cbt-9d3c9e9087a6dc0a4445f9428e02f6e7612470c6.tar.bz2 cbt-9d3c9e9087a6dc0a4445f9428e02f6e7612470c6.zip |
Merge pull request #235 from cvogt/dotty
Dotty plugin and example project.
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) |