-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Suppress "extension method will never be selected" for overrides
When we're overriding an existing extension method, we don't have the liberty of renaming the method, so we shouldn't get warnings we can't do anything about.
- Loading branch information
Showing
2 changed files
with
40 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
//> using options -Xfatal-warnings | ||
|
||
trait Foo[T]: | ||
extension (x: T) | ||
def hi: String | ||
|
||
class Bla: | ||
def hi: String = "hi" | ||
object Bla: | ||
given Foo[Bla] with | ||
extension (x: Bla) | ||
def hi: String = x.hi |