-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Labels
area:lintingLinting warnings enabled with -W or -XlintLinting warnings enabled with -W or -Xlintbetter-errorsIssues concerned with improving confusing/unhelpful diagnostic messagesIssues concerned with improving confusing/unhelpful diagnostic messagesitype:bug
Description
Compiler version
3.8
Minimized code
class Foo(val someField: Int)
extension (foo: Foo)
def someField = foo.someField // warns even if private
def bar1 = 1 + someField
def bar2 = 2 + someField
def bar3 = 3 + someField
Output
5 | private def someField = foo.someField
| ^
|Extension method someField will never be selected from type Foo
|because Foo already has a member with the same name and compatible parameter types.
Expectation
No warning because it is false. It's never too late to push back against false claims by tools and politicians.
The method is already known to be used under -Wunused
. This warning could be under the same flag.
Note that the user might want an unusable extension because it is usable under an older JVM or other dependency. It might be nicer to make the warning "opt-in".
Metadata
Metadata
Assignees
Labels
area:lintingLinting warnings enabled with -W or -XlintLinting warnings enabled with -W or -Xlintbetter-errorsIssues concerned with improving confusing/unhelpful diagnostic messagesIssues concerned with improving confusing/unhelpful diagnostic messagesitype:bug