summaryrefslogtreecommitdiff
path: root/core/src/test
diff options
context:
space:
mode:
authorLi Haoyi <haoyi.sg@gmail.com>2017-12-15 17:41:32 -0800
committerLi Haoyi <haoyi.sg@gmail.com>2017-12-15 17:42:22 -0800
commit4ec6dca8c3432339620bbc6298fdf75a4b930fb4 (patch)
tree1c17bb9bb3477be1b498c72ff2c74b9d235dd4bd /core/src/test
parent3a40842d7b3aeedddb9ab5e8261dd48ea4e024b6 (diff)
downloadmill-4ec6dca8c3432339620bbc6298fdf75a4b930fb4.tar.gz
mill-4ec6dca8c3432339620bbc6298fdf75a4b930fb4.tar.bz2
mill-4ec6dca8c3432339620bbc6298fdf75a4b930fb4.zip
First pass at using a compiler plugin to remove the need for the `override` keyword when overriding a field within a `mill.Module`
This only applies to `mill.Module`s, not overrides elsewhere which still require the keyword. `mill.Module`s tend to have lots and lots of overriding, so the keyword is basically noise. Also includes the necessary build changes to enable the locally-built Scalac plugin when compiling the test suite. Note that no changes are necessary for the executable assembly, because the `scalac-plugin.xml` will be included in the assembly and get picked up by the Ammonite scalac plugin classloader automatically
Diffstat (limited to 'core/src/test')
-rw-r--r--core/src/test/scala/mill/define/CacherTests.scala15
1 files changed, 14 insertions, 1 deletions
diff --git a/core/src/test/scala/mill/define/CacherTests.scala b/core/src/test/scala/mill/define/CacherTests.scala
index bacfa598..4b8e31ab 100644
--- a/core/src/test/scala/mill/define/CacherTests.scala
+++ b/core/src/test/scala/mill/define/CacherTests.scala
@@ -14,7 +14,7 @@ object CacherTests extends TestSuite{
}
object Middle extends Middle
trait Middle extends Base{
- override def value = T{ super.value() + 2}
+ def value = T{ super.value() + 2}
def overriden = T{ super.value()}
}
object Terminal extends Terminal
@@ -49,6 +49,19 @@ object CacherTests extends TestSuite{
eval(Terminal, Terminal.value) == 7,
eval(Terminal, Terminal.overriden) == 1
)
+ // Doesn't fail, presumably compileError doesn't go far enough in the
+ // compilation pipeline to hit the override checks
+ //
+ // 'overrideOutsideModuleFails - {
+ // compileError("""
+ // trait Foo{
+ // def x = 1
+ // }
+ // object Bar extends Foo{
+ // def x = 2
+ // }
+ // """)
+ // }
}
}