Skip to content

Commit

Permalink
Prefer context functions, avoid intermediate collections
Browse files Browse the repository at this point in the history
  • Loading branch information
som-snytt committed Jul 7, 2024
1 parent d0d3711 commit 741473e
Show file tree
Hide file tree
Showing 2 changed files with 126 additions and 178 deletions.
15 changes: 7 additions & 8 deletions compiler/src/dotty/tools/dotc/reporting/messages.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3277,11 +3277,10 @@ extends Message(UnusedSymbolID) {
override def explain(using Context) = ""
}

object UnusedSymbol {
def imports(using Context): UnusedSymbol = new UnusedSymbol(i"unused import")
def localDefs(using Context): UnusedSymbol = new UnusedSymbol(i"unused local definition")
def explicitParams(using Context): UnusedSymbol = new UnusedSymbol(i"unused explicit parameter")
def implicitParams(using Context): UnusedSymbol = new UnusedSymbol(i"unused implicit parameter")
def privateMembers(using Context): UnusedSymbol = new UnusedSymbol(i"unused private member")
def patVars(using Context): UnusedSymbol = new UnusedSymbol(i"unused pattern variable")
}
object UnusedSymbol:
def imports(using Context): UnusedSymbol = UnusedSymbol(i"unused import")
def localDefs(using Context): UnusedSymbol = UnusedSymbol(i"unused local definition")
def explicitParams(using Context): UnusedSymbol = UnusedSymbol(i"unused explicit parameter")
def implicitParams(using Context): UnusedSymbol = UnusedSymbol(i"unused implicit parameter")
def privateMembers(using Context): UnusedSymbol = UnusedSymbol(i"unused private member")
def patVars(using Context): UnusedSymbol = UnusedSymbol(i"unused pattern variable")
Loading

0 comments on commit 741473e

Please sign in to comment.