tox4j / deprecated-tox4j

Deprecated, see http://github.com/TokTok/jvm-toxcore-c
http://github.com/TokTok/jvm-toxcore-c
Other
42 stars 17 forks source link

Linter: Method definition shouldn't take an empty argument list #122

Open nbraud opened 9 years ago

nbraud commented 9 years ago

Currenly, code such as the following compiles without warning:

final object Test {
  def method() = 42
}

def method should be used instead of def method().

nbraud commented 9 years ago

@iphydf: Confirm we don't want that either?

iphydf commented 9 years ago

This is correct, but we do want () for Unit-returning, or actually even for effectful methods (not sure we can enforce that.. maybe we can have a @pure annotation for that, but that's a lot more work to verify). For now, any nullary method returning non-Unit should not have (), any nullary method returning Unit should.

iphydf commented 9 years ago

In this particular example, we also check for "public method has explicit type", already checked by Scalastyle, so we don't need to check for that.