scapegoat icon indicating copy to clipboard operation
scapegoat copied to clipboard

False Positive: EmptyMethod

Open hzwaal opened this issue 10 years ago • 1 comments

Of course scapegoat is correct for the below example, but IMHO it should not report this if the method is implementing a Unit function.

  abstract class Thing {
    def method(): Unit
  }

  class DoNoThing extends Thing {
    // EmptyMethod: below code gives a warning that cannot be helped
    def method(): Unit = ()
  }

hzwaal avatar Sep 11 '15 13:09 hzwaal

Not thinking about it too much, but I guess it's more about the super class being abstract, not that the return type is Unit.

mccartney avatar Oct 04 '20 20:10 mccartney