Skip to content

Commit

Permalink
Merge pull request #5460 from som-snytt/issue/6978
Browse files Browse the repository at this point in the history
SI-6978 No linting of Java parens
  • Loading branch information
retronym committed Nov 10, 2016
2 parents e0a0d3d + c71dfa1 commit c39b31c
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/compiler/scala/tools/nsc/typechecker/RefChecks.scala
Expand Up @@ -472,7 +472,7 @@ abstract class RefChecks extends Transform {
checkOverrideTypes()
checkOverrideDeprecated()
if (settings.warnNullaryOverride) {
if (other.paramss.isEmpty && !member.paramss.isEmpty) {
if (other.paramss.isEmpty && !member.paramss.isEmpty && !member.isJavaDefined) {
reporter.warning(member.pos, "non-nullary method overrides nullary method")
}
}
Expand Down
1 change: 1 addition & 0 deletions test/files/pos/t6978.flags
@@ -0,0 +1 @@
-Xlint -Xfatal-warnings
5 changes: 5 additions & 0 deletions test/files/pos/t6978/J.java
@@ -0,0 +1,5 @@

public class J {
public int f() { return 42; }
}

7 changes: 7 additions & 0 deletions test/files/pos/t6978/S.scala
@@ -0,0 +1,7 @@

trait X { def f: Int }

object Test extends J with X with App {
println(f)
}

0 comments on commit c39b31c

Please sign in to comment.