Give a concrete definition of trivial methods and update the way they are identified in the CheckUnused phase
Nobody has claimed this yet.
- Dominant language
- Scala
- Stars
- 6.3k
- Forks
- 1.2k
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 126
Description
In #16157, -Wunused:params do not report trivial methods. These are currently identified as in Scala 2, i.e. by checking if their right hand side type is either: a constant type, single type, a literal, etc. See this comment.
The idea is to give a concrete formal definition of trivial methods, and update the code that identify them here .
Here's an idea of a trivial method:
def foo(a: Int, b: String) = ???
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with compiler/src/dotty/tools/dotc/transform/CheckUnused.scala at the linked identification code and review the discussion in #16157. Compare the current Scala 2-style checks with the proposed formal definition of trivial methods. Done means the definition is concrete and the CheckUnused phase identifies methods accordingly for -Wunused:params.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- scala
- Domain
- compilers
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100