Skip to content

[javac vs ecj] default method without return isn't reported when there's other compilation errors #4855

@datho7561

Description

@datho7561

Here's an example:

public interface MyInterface {
	default int foo() {

	}
	int i = foo();
}

javac reports two errors:

  1. There's no return statement in the default implementation of foo()
  2. foo() is not static, so it can't be called to initialize i

ecj only reports the second error. If the declaration for i is removed completely, then it will report the first error.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions