diff options
author | Li Haoyi <haoyi.sg@gmail.com> | 2018-01-13 22:31:32 -0800 |
---|---|---|
committer | Li Haoyi <haoyi.sg@gmail.com> | 2018-01-13 22:31:32 -0800 |
commit | ff7eadd0d926a980ae31261bb84900640ca4cd9b (patch) | |
tree | 4269604b19a9471b124743bbeb94ff536863704b /core/src/main/scala | |
parent | 7589250f87dd70e52cec923dcda5d554a4c7bbcb (diff) | |
download | mill-ff7eadd0d926a980ae31261bb84900640ca4cd9b.tar.gz mill-ff7eadd0d926a980ae31261bb84900640ca4cd9b.tar.bz2 mill-ff7eadd0d926a980ae31261bb84900640ca4cd9b.zip |
Make `Module#reflect` only return instance methods
Diffstat (limited to 'core/src/main/scala')
-rw-r--r-- | core/src/main/scala/mill/define/Module.scala | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/core/src/main/scala/mill/define/Module.scala b/core/src/main/scala/mill/define/Module.scala index 064741c4..5eee6ddf 100644 --- a/core/src/main/scala/mill/define/Module.scala +++ b/core/src/main/scala/mill/define/Module.scala @@ -1,5 +1,7 @@ package mill.define +import java.lang.reflect.Modifier + import ammonite.main.Router.Overrides import ammonite.ops.Path @@ -61,6 +63,7 @@ class Module(implicit ctx0: Module.Ctx) extends mill.moduledefs.Cacher{ .getClass .getMethods .filter(_.getParameterCount == 0) + .filter(x => (x.getModifiers & Modifier.STATIC) == 0) .filter(implicitly[ClassTag[T]].runtimeClass isAssignableFrom _.getReturnType) .map(_.invoke(this).asInstanceOf[T]) } |