diff options
author | Li Haoyi <haoyi.sg@gmail.com> | 2017-11-04 14:48:23 -0700 |
---|---|---|
committer | Li Haoyi <haoyi.sg@gmail.com> | 2017-11-04 14:48:23 -0700 |
commit | 7360d060f8da122cf233f6b761cc49044574d2fc (patch) | |
tree | 985710c39c1bc8fb05a0701899de6c5e426a8e1d /core/src/test/scala | |
parent | bc6eb79f74a30aef2eb874eb7ba3c443c49e7554 (diff) | |
download | mill-7360d060f8da122cf233f6b761cc49044574d2fc.tar.gz mill-7360d060f8da122cf233f6b761cc49044574d2fc.tar.bz2 mill-7360d060f8da122cf233f6b761cc49044574d2fc.zip |
Collapse `LocalDef` into `T{...}` macro, make it more flexible so it only caches `def`s (and complains about `val`s) if it's defined top-level in a class/trait/object, for easy overriding.
If it's in some helper function somewhere, overriding doesn't matter, and it's up to the user to figure out how to construct a target graph without redundancy
Diffstat (limited to 'core/src/test/scala')
-rw-r--r-- | core/src/test/scala/forge/CacherTests.scala | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/core/src/test/scala/forge/CacherTests.scala b/core/src/test/scala/forge/CacherTests.scala index c6157a4a..de8265bd 100644 --- a/core/src/test/scala/forge/CacherTests.scala +++ b/core/src/test/scala/forge/CacherTests.scala @@ -48,13 +48,10 @@ object CacherTests extends TestSuite{ ) 'errors{ val expectedMsg = - "T{} can only be used directly within a zero-arg method defined in a class body" + "T{} members defined in a Cacher class/trait/object body must be defs" val err1 = compileError("object Foo extends Target.Cacher{ val x = T{1} }") assert(err1.msg == expectedMsg) - - val err2 = compileError("object Foo extends Target.Cacher{ def x = {def y = T{1}} }") - assert(err2.msg == expectedMsg) } } } |